I have connected to mysql console by "mysql -uroot -p" , then use the command "show processlist ;" to list the processes , but I can't see the result , may be the command is too long , the column only allow around 85 characters , the command should over the limit , how can I see the full command ?
thanks
Hello,
In debian I created a new user "myUser".
In /home/myUser/.profile
I added "mysql -u user -password"
So automatically after login to linux terminal the user is logged in mysql command line.
What I need to do is to exit terminal after user exit mysql, so he want have access to comand line.
I am in the process of setting up my first VPS to host a website that I have been working on. By profession, I am a programmer, so I know nothing of Linux or web hosting!!
Thanks to lots of help on here this weekend, I finally learned how to access my VPS using SSH. (That only took a day or two to learn!) And my first command-line task was learning how to copy a file to another folder while maintaining the original modified date. (That only took another half-day!)
Whew!
So the next thing that I need to do is set up MySQL on my VPS...
My VPS runs on CentOS 6, and it also comes with cPanel, but since astrogeek and Miati were persistent in explaining why it is better to do things via the command-line versus using a GUI, I figured I would check things out...
My cPanel comes with some "wizard" that supposedly sets up a MySQL database for you, but whenever I see "wizard" I tend to run!
Advanced Support for my web host said that I should definitely use cPanel to create my database and create the users, because if I did it using phpMyAdmin it would supposedly mess things up as cPanel wouldn't recognize things?
(BTW, I requested MySQL Root access this morning, but I do not have Root access to my VPS - by choice for now!)
Questions:
1.) Should I listen to my web host and use the cPanel wizard to create a new MySQL database?
2.) If I decide to bypass cPanel, how exactly would I use my MacBook to talk to my VPS and do MySQL stuff over command-line?
FWIW, I developed my entire database using phpMyAdmin in MAMP on my MacBook. When I created my original database in development, I used phpMyAdmin's GUI. And then for everything else (e.g. create table, indexes, queries, etc.), I hand-wrote the SQL in TextEdit and then ran it in phpMyAdmin.
But I have no clue how to do any of this on my VPS!!
3.) How would I use the command-line to create a new database and set up groups and users for MySQL?
4.) If I did things by command-line, is it true that I would break cPanel?
I have been working on my website for the last 3 years, and it is ready to "go live", but I am discovering that setting up my VPS properly - and with lots of security - and getting things like PHP and MySQL set up is a very daunting task!!!
Sincerely,
Rob
Hi,
I am trying to remove the Column from .CSV using Awk Command. Below is the input
Name,Age,Description,Location
Gopal,32,Tech Lead,"Ramnagar, Naintal"
Gaurav,24,"Linux Admin, Expert","Noda"
I want column 1,2,4 and i am using below mention command
awk -F, ' BEGIN { OFS="," }
{
print $1,$2,$4
}' new.csv > new-done.csv
but instead of getting Gaurav,24,Noda
i am getting
Name,Age,Location
Gopal,32,"Ramnagar
Gaurav,24, Expert"
I have installed httpd, mysql, php on a centos machine. Php executes in the browser of my machines website, mysql can be ran from the command line, but mysql within php in a browser will not work.
I know my code is syntactically correct since it will run on another Centos Lamp machine and NetBeans says it is.
My code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="300">
<title> Freeze Warn Points table Query"</title>
</head>
<body>
<?php
include("config.php");
echo $dbhost;
echo "<br />\n";
echo $dbuser;
echo "<br />\n";
echo $dbpasswd;
echo "<br />\n";
mysql_connect($dbhost, $dbuser, $dbpasswd) or die("Unable to connect to database");
echo 'Connected Successfully';
mysql_select_db($dbname);
echo "zone"." ";
echo "currentLow"." "."dateLastRep"." ";
echo "priority"." "."siteId"." &nbs p; "."siteName";
echo "<br />\n";
$result = $sql = 'SELECT zone, currentLow, dateLastRep, pri, siteId, siteName from points order by zone, pri';
$numRows = mysql_num_rows($result);
echo "Matches: ".mysql_num_rows($result);
for($a=0; $a<$numRows; $a++)
{ $rowArray = mysql_fetch_row($result);
echo $rowArray[0]." ".$rowArray[1]." ".$rowArray[2]." ".$rowArray[3]." ".$rowArray[4]."  ".$rowArray[5]."<br />";
}
mysql_close();
?>
</body>
</html>
When executed on the CENTOS lamp machine in question out puts this
"; $result=mysql_query("SELECT rpad(zone,6,'-'), rpad(currentLow,13,'-'), rpad(dateLastRep,13,'-'), rpad(pri,8,'-'), rpad(siteId,6,'-'), siteName from points order by zone, pri"); $numRows = mysql_num_rows($result); for($a=0; $a<$numRows; $a++) { $rowArray = mysql_fetch_row($result); echo $rowArray[0]." ".$rowArray[1]." ".$rowArray[2]." ".$rowArray[3]." ".$rowArray[4]." ".$rowArray[5]."
"; } mysql_close(); ?>
When I put the same code in the other machine, (it does not have the mysql database so it will not connect) displays this
204.227.112.31
apache
password
Unable to connect to database
httpd is running of course
mysqld is running
I have
mysql-server-5.1.73-3.el6_5.x86_64
php-mysql-5.3.3-40.el6_6.x86_64
mysql-devel-5.1.73-3.el6_5.x86_64
mysql-libs-5.1.73-3.el6_5.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
mysql-5.1.73-3.el6_5.x86_64
php-mbstring-5.3.3-40.el6_6.x86_64
php-odbc-5.3.3-40.el6_6.x86_64
php-imap-5.3.3-40.el6_6.x86_64
php-mysql-5.3.3-40.el6_6.x86_64
php-xml-5.3.3-40.el6_6.x86_64
phpmyadmin-2.11.11.3-2.el6.rf.noarch
php-cli-5.3.3-40.el6_6.x86_64
php-xmlrpc-5.3.3-40.el6_6.x86_64
php-gd-5.3.3-40.el6_6.x86_64
php-5.3.3-40.el6_6.x86_64
php-pdo-5.3.3-40.el6_6.x86_64
php-common-5.3.3-40.el6_6.x86_64
php-ldap-5.3.3-40.el6_6.x86_64
php-pear-1.9.4-4.el6.noarch
Installed.
I checked the php.ini files and the httpd.conf files with the LAMP machine it works on and have been unable to find any discrepancies.
Unless I missed something.
Selinux is disabled.
I know it is not my code, but some type of setting somewhere on my machine, I have not been able to find.
I have been unable to find any thing like this issue.
Thanks,
Nancy
Hi everyone,
i tried to install mysql on my slackware 14.1.
typed mysql_install_db --user=mysql and went to the automatic configuration of secure access and receive this "Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)".
How can remove this installation, to try to reinstall the db?
And another error when try to reinstall :
"bash-4.2# mysql_install_db --user=mysql
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
150130 9:40:11 [ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13)
150130 9:40:11 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
150130 9:40:11 [ERROR] Plugin 'Aria' init function returned error.
150130 9:40:11 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
150130 9:40:11 [ERROR] mysqld: Can't find file: './mysql/db.frm' (errno: 13)
ERROR: 1017 Can't find file: './mysql/db.frm' (errno: 13)
150130 9:40:11 [ERROR] Aborting
150130 9:40:11 [Note] /usr/libexec/mysqld: Shutdown complete
Installation of system tables failed! Examine the logs in
/var/lib/mysql for more information.
The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:
shell> /scripts/mysql_install_db --defaults-file=~/.my.cnf
You can also try to start the mysqld daemon with:
shell> /usr/libexec/mysqld --skip-grant --general-log &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using
--general-log gives you a log in /var/lib/mysql that may be helpful.
The latest information about mysql_install_db is available at
http://kb.askmonty.org/v/installing-...sql_install_db.
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria
Please check all of the above before mailing us! And remember, if
you do mail us, you should use the /usr/bin/mysqlbug script!
bash-4.2#
"
After i've execute $ isql -v database dsn name command i get an error in form:"Floating point exception (core dumped)". My comp is Lenovo with 64b AMD processor and my OS is Ubuntu 15.04. As a noobie i suppose the error is in my libmyodbc.so driver. Any advice will be a ppreciated.
marijan
Hey guys,
I have fedora version 8 with mysql 5.0.45 istalled. I have also installed drupal. Recently drupal gave me an error "error code 28". When i checked it out it seemed to be with the db. When i tried to created a db (for testing puposes) in root...i wasnt able to. so then i tried to restart mysql ...it stopped but unfortunately i have not been able to get mysql back up...i get a messeage saying
"Timeout error occurred trying to start MySql Daemon"
Could you please assist...
Thanks in advance,
Note: Ubuntu 14 latest release
I am a highly experienced unix user with many years of experience. However, I retired 13 years ago so I can't remember some simple things so forgive me for posting here.
I am trying to use the "zenity --list --radiolist" command. Now this requires that the list of items be last and be of the form
FALSE <item name>
as in
FALSE "Choice 1" FALSE "Choice 2"
That's easy without variables. It would be
zenity --list --radiolist [other options here] FALSE "Choice 1" FALSE "Choice 2
Works fine.
But what I have is a list of choices in an array. Each of these is a string of multiple words and I have tried (nearly?) everything using echo command piped into zenity (supposed to work) to including an array element in the line with all sorts of quotes, single quotes, escaping quotes, etc. I have even included the "FALSE" in the variable so as not to have to generate it. Nothing works. When using the set -x, it shows that the shell has put a single quote around each word which makes each word a separate parameter.
I have searched all sorts of examples of zenity but the requirement for the word "FALSE" between each item while using variables is never shown.
If anyone has a working example of something like this (or any simple alternative:
JTemp[3]="This is a string"
echo "FALSE "${Jtemp[3]} | zenity --list --radiolist --text "Select Topic" --column "Topic" --column "Pick one"
which should display a radiobox with one entry, I would appreciate it. I could then expand it to include all the array elements.
I know I am doing something simple wrong. I just can't figure it out.
Note that I am writing this on a windows machine and using a non-internet-connected linux machine for my work so if I typed the command line wrong, it may be a problem here and not on the real machine.
Thanks for any help.
Hi all ,
I have a requirement where I have a file. Contents of the file are :
#comments
VAR="abg"
RES=123
#comments
IC6790ABG="https://www.abc.com"
IC5678-vg="https://www.bhy.com"
IC-gy_567:78="https://www.gyt.com"
#comments
The variable names can not have characters like - , : so
in this file I have to find words starting with IC and replace characters like - ,:
I want to change only the variable name , not the whole line.
I have used SED command
sed -i '/^IC/s/[^0-9 a-z A-Z _]*//g' file
when I am using this command , it is replacing the whole line
output becomes :
#comments
VAR="abg"
RES=123
#comments
IC6790ABGhttpswwwabccom
IC5678vghttpswwwbhycom
ICgy56778httpswwwgytcom
#comments
But I want the output like this :
#comments
VAR="abg"
RES=123
#comments
IC6790ABG="https://www.abc.com"
IC5678vg="https://www.bhy.com"
ICgy_56778="https://www.gyt.com"
#comments
How can I get the desired output , thanks for your help in advance .
Hi, I've just recently installed MySQL connector/c from source code on my Slackware 14.1 x64
I read the official instructions of the connector but I felt a bit disorientated when I read:
Code:
1 -Change location to the top-level directory of the source distribution.
I interpreted that I have to go to the "highest" directory
Code:
/
So I wrote:
Code:
# cd /
root@- /# tar xzvf /home/normal/Downloads/mysql-connector-c-6.1.6-src.tar.gz
root@- /# cd /mysql-connector-c-6.1.6-src/
root@- /mysql-connector-c-6.1.6-src# cmake -G "Unix Makefiles"
root@- /mysql-connector-c-6.1.6-src# make
root@- /mysql-connector-c-6.1.6-src# make install
Then I did:
Code:
ln -s /usr/local/mysql-5.6.25/include /usr/include
But when I try to compile a program in c with #include <mysql.h> i get this error:
Code:
# gcc ctemp.c
In file included from ctemp.c:2:0:
/usr/include/mysql.h:57:27: fatal error: mysql_version.h: No such file or directory
#include "mysql_version.h"
^
What can I do? Thanks a lot and sorry for poor english
PD: If you need the official instructions I paste here the link: https://dev.mysql.com/doc/connector-...on-source.html