[MySQL] Centos6.x 解決 MySQL啟動失敗ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql)
不論是啟用service mysql start或是重啟 service mysql restart都會出現 ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql)怎麼辦?以下是我的解決方法:
環境:
Centos6.7
MariaDB
解決方法:
1.先輸入service mysql status,由於執行失敗,service mysql status會顯示錯誤引導你
service mysql status
2.系統顯示MySQL is not running, but lock file (/var/lock/subsys/mysql),這時候先將這個檔案刪掉試試,輸入
rm var/lock/subsys/mysql
3.在嘗試service mysql restart
4.若還是無法啟用,輸入ps -ef | grep mysql查看process,會看到mysql的process,記住 PID
ps -ef | grep mysql
5.輸入sudo kill -9 PID ,-9是強制刪除,指定mysql的PID,刪除process
sudo kill -9 PID
6.最後再重啟一次,就行了
留言
張貼留言