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

shido

Registered
Oct 8, 2008
4
2
53
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

kennysamuerto

Member
PartnerNOC
May 20, 2009
24
6
53
cPanel Access Level
Root Administrator
Hello,

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.
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
558
257
138
IN
cPanel Access Level
Root Administrator
I agree with kennysamuerto, more information will help to get better advice to fix the problem.
 
  • Like
Reactions: cPanelAnthony

shido

Registered
Oct 8, 2008
4
2
53
I have migrated everything to a new server so this thread can be closed. I had to reinstall each data base individually.
 
  • Like
Reactions: cPanelAnthony