SOLVED Server crashed now - ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)


Oct 8, 2008
On Tuesday my server crashed and was powercycled. When it came back up all websites were down and I keep getting an error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

When I look at PHPMyadmin I get a bunch of errors as well. The SQL backup in all recent backup files from Tuesday onward are blank and I have a file there called openfileslimit which has the number 40000 in it.

I have set up a new server and tried to transfer the accounts over to it in the hope that the transferred backups would work and I can carry on. The problem is when I do a transfer I also get the error

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

and so I can not transfer the accounts to the new server with the most recent database info.

Please help! I have 112 website down right now and for the life of me I cant work out how to fix the error!
  • Like
Reactions: cPanelAnthony


May 20, 2009
cPanel Access Level
Root Administrator

You offer little information, we should start from the basics.

What error do you get when starting MySQL?

Try to start MySQL from SSH, and in case of error, enter the command:

journalctl -xe

See the error log it tells you, to try to solve what is preventing MySQL from starting.

Try also the command df -h, although it is a theory, I am afraid you may be out of space on your server.

After that, let us know the results of the commands.