开发者

Cannot connect to Mysql Socket

开发者 https://www.devze.com 2023-03-20 02:00 出处:网络
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 fol

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
0

精彩评论

暂无评论...
验证码 换一张
取 消