Can ' t connect to local MySQL server through socket

Source: Internet
Author: User

This morning, when testing the code, I found that it always timed out when I was writing MySQL, and then failed, using the MySQL command

Show Processlist;

found that two update SQL statements have been executed for a long time, that the two programs to lock the table, and then ready to kill the two requests, kill several times is a failure, so decided to restart MySQL. But restarting the connection to MySQL again found not connected, the error is as follows:

2002 (HY000): Can'/var/lib/mysql/mysql.sock'

Then use the command to see if MySQL is really up.

PS -a| grep MySQL

View, two processes are started, look is normal, but the view port found that 3306 port does not open, what problem???

Go ahead and look at what state MySQL is currently in.

Service MYSQLD Status

The output is not what you just thought:

MySQL is running but PID file could not being found

There are netizens prompt to kill the MySQL process, and then restart, try, invalid.

View the MySQL error log, which displays the following information:

' ./mysql-bin.~rec~ '  -  for  Free  -  for server to continue after freeing disk space)

The original disk is insufficient, clean up the next disk is OK.

Can ' t connect to local MySQL server through socket

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.