MySQL: mysql is not running but lock exists 的處理辦法。本站提示廣大學習愛好者:(MySQL: mysql is not running but lock exists 的處理辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是MySQL: mysql is not running but lock exists 的處理辦法正文
啟動MySQL失足,檢查了下狀況,發明提醒MySQL is not running,but lock exists:
一個網友說能夠和log文件有關,因而將log文件給移除,再重啟MySQL終究OK了
找了下材料,根本上都是說:
# chown -R mysql:mysql /var/lib/mysql
# rm /var/lock/subsys/mysql
# service mysql restart
履行完發明照樣這個提醒。
由於是在cPanel辦事器上,所以又經由過程敕令:
# yum remove mysql mysql-server
將mysql卸載了,然後從新裝置:
# /scripts/mysqlup –force
裝好以後發明重啟照樣失足,又賣力看了下,發明pid文件不是以以後的主機名定名的,因而履行:
# echo `ps aux | grep mysql | grep “user=mysql” | grep -v “grep” | awk ‘{print $2}'`>> hostname.pid
從新生成了下pid文件,同時修正owner和group為mysql:
# chown mysql:mysql hostname.pid
以後保留再重啟照樣失足。
最初查到一個網友說能夠和log文件有關,因而將log文件給移除,再重啟MySQL終究OK了。
A MySQL crash on Red Hat system resulted with:
/etc/init.d/mysql status
coming back with:
mysql is not running but lock exists
Solved by removing the lock file:
rm /var/lock/subsys/mysql
If this happens again it may also be necessary to remove the pid file from /var/lib/mysql