I download the Percona-Server-5.6.14-rel62.0-483.Linux.x86_64.tar from the percona.com.
When I tar this file and try to execute the mysql command, it gives me the error
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
But in my my.cnf, I set the sock=/var/lib/mysql/mysql.sock.
I know that if I make a link-file to point this real socket file in the /var/lib/mysql dir can reslove this problem.
But I want to know how the /app/mysql/bin/mysql to executed. Why it find the socket file from the /tmp dir.
Is this can be configure in the Percona or in the RedHat System?
Below is my uname -a result:
2.6.32-262.el6.x86_64 #1 SMP Sun Apr 8 18:38:00 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
So if you have non-default socket place specified in my.cnf ([mysqld] section) then you can connect to mysql by the following ways:
specify socket explicitly in connection string:
mysql -u root -p -S /var/lib/mysql/mysql.sock
OR
add the socket info to [client] section in my.cnf (and restart mysql) so your config file will be looking like below:
[mysqld]
…
socket = /var/lib/mysql/mysql.sock
[client]
…
socket = /var/lib/mysql/mysql.sock
In this case you’ll be able to connect w/o specifying socket, like below:
mysql -u root -p
That’s because:
socket in [mysqld] - the path where server will place a .sock file
socket in [client] - the path where will be looking for .sock file while connecting
It seams you changed the name? Or maybe I was missing.
I delete the default /etc/my.cnf all ready for this test.
Maybe I think this is the OS problem. As you know, some packages maybe included in the OS.
When I executed mysql, may this bin file is not Percona’s mysql.
I will try to executed /app/mysql/bin/mysql and watch it’s out.
Thanks a lot for your help and be sorry for update so late.