user839884
user839884

Reputation: 11

Cannot connect to Mysql Socket

I have an AWS server. I have mysql running and it connects just find to my RDS server, but 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.

Upvotes: 1

Views: 5197

Answers (1)

dabest1
dabest1

Reputation: 2502

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

Upvotes: 1

Related Questions