Early in the morning I heard the system hangs, check the tomcat, found that Tomcat himself broke, my Tomcat always after a period of time automatically turn off, here is not discussing the problem of Tomcat, normally, after restarting Tomcat, the system will return to normal, but today there is no , because MySQL also hangs up. As it has been a few hours now, I do not remember the specific code of the error at that time, simply record the problem-solving process for future reference. The process of solving the problem consists of the following attempts, in chronological order
1, try to enter the MySQL look, enter Mysql-u root-p, after I enter the password, the prompt cannot enter MySQL through Mysql.sock.
2, the problem locked to Mysql.sock, the error message input Baidu, find the reason, some people say is Mysql.sock lost, view/etc/ MY.CNF, find Mysql.sock storage location, and then enter the location, find, there is no mysql.sock, again Baidu Mysql.sock lost what to do, try to restart, but found that there is no way to restart, after restarting the machine is also invalid; by command mysq- H 127.0.0.1-u root-p (not using sock, via TCP) also fails to enter MySQL. Eliminate the sock problem.
3, check the MySQL error log file, found the key issue:
There is not enough disk space, so I looked at the usage of all the disks:
So, clean out the useless things in/Var, mysql back to normal. The system is back to normal and the problem is solved.
Through today's example tell me, in the future encounter problems, the first thing must be to check the error log, the system to our feedback is the most direct and effective.
MySQL does not start, error 2002, unable to connect