MySQL does not start, error 2002, unable to connect

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.