In terms of servers in the company, sometimes there is a small problem during the holiday. You need to access the database, but you cannot connect it with graphic tools, after that, you can remotely log on to the linux server where mysql is located and cannot log on normally, but you can use it on the company's computer (this problem is still unknown, it is strange, or do you know too little about it?
In terms of servers in the company, sometimes there is a small problem during the holiday. You need to access the database, but you cannot connect it with graphic tools, after that, you can remotely log on to the linux server where mysql is located and cannot log on normally, but you can use it on the company's computer (this problem is still unknown, it is strange, or do you know too little about it?
In terms of servers in the company, sometimes there is a small problem during the holiday. You need to access the database, but you cannot connect it with graphic tools, after that, you can remotely log on to the linux server where mysql is located and cannot log on normally, but you can use it on the company's computer (this problem is still unknown, it is strange, I know too little about it myself !), Today I encountered this problem again. Record the solution.
Go to linux and log on to mysql. The following occurs:
[Root @ streeteast ~] # Mysql-uroot-p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql. sock' (2)
Try to restart the mysql service in the following situations:
[Root @ streeteast ~] # Service mysql stop
MySQL server PID file cocould not be found! [FAILED]
Speechless!
I searched the information and said that the mysql process was locked. Therefore, run the top command to check whether the USER is a mysql process sometimes. Check its PID and kill it, then execute the service mysql start command, and find out the cause.