Millar

Active Member
Dec 23, 2006
29
0
151
My MySQL isn't working, on attempted restart, get this error..
/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").
/var/lib/mysql/mysql.sock doesn't exist, is there another location where it does exist? or anyway to create it again?
 

stankdawg

Registered
Nov 5, 2005
3
0
151
bumped

I am having this as well so I am bumping this thread. It seems intermittent.

I have followed multiple suggestions from this forums and the FAQ (worthless advice... "Is mySQL running?" OBVIOUSLY NOT if we have this error message!). I cannot find the file anywhere on the server. I looked in the default locations according to mysql documentation.

How and where do I recreate it? I certainly did not delete it myself.
 

dafut

Well-Known Member
Dec 14, 2005
74
0
156
The mysql.sock file is created when mysql starts. If one exists because mysql crashed then this can prevent mysql from starting.

Look in /tmp or /var/tmp. If you see a "mysql.sock -> ../../var/lib/mysql/mysql.sock= " then delete it.

Then try starting mysql.