I have an AWS server. I have mysql running and it connects just find to my RDS server, b开发者_开发百科ut I want a local mysql instance running. When I type mysql into the command prompt I get the following.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
my.conf is as follows
datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
socket=/tmp/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
Running find mysql.sock does not return any results.
Look at the mysql process(es) running:
ps -aef | grep mysql
Look for something like
--socket=/path/mysql.sock
Fix my.cnf to reflect the correct path and name.
OR
As mysql or root user:
lsof | grep mysql.sock
精彩评论