Today, I want to change the PATH environment variable compiled and installed on cetnos6 to the PATH environment variable. After several operations, I will fail to shut down or restart mysql. The prompt is as follows:
[Root @ web1 ~] # Service mysqld stop
MySQL server PID file cocould not be found! [FAILED]
Google, the solution is as follows:
Check the process:
[Root @ web1 ~] # Ps aux | grep mysq *
Mysql 16058 0.2 11.2 995540 112956? Sl mysqld
Root 17233 0.0 0.0 103316 848 pts/2 S + grep mysq *
If you see the above content, it means that the Mysql process is stuck, and you need to close these dead processes:
[Root @ web1 ~] # Kill-9 16058
[Root @ web1 ~] # Kill-9 17233
-Bash: kill: (17233)-No such process
Start Mysql again. You can restart Mysql several times and start Mysql successfully.
[Root @ web1 ~] # Service mysqld stop
MySQL server PID file cocould not be found! [FAILED]
[Root @ web1 ~] # Service mysqld restart
MySQL server PID file cocould not be found! [FAILED]
Starting MySQL... [OK]
[Root @ web1 ~] # Service mysqld restart
Shutting down MySQL. [OK]
Starting MySQL... [OK]
[Root @ web1 ~] #