1. 程式人生 > >MYSQL dead but pid file exists問題

MYSQL dead but pid file exists問題

伺服器突然斷電,造成MySQL資料庫啟動不了的問題,現象如下:

[[email protected] html]# service mysql51-mysqld start
kill 31011: No such process
Another MySQL daemon already running with the same unix socket.
Starting mysql51-mysqld:                                   [FAILED]

[[email protected] html]# service mysql51-mysqld status
mysql51-mysqld dead but pid file exists

本想找pid檔案刪除,後來找不到這個檔案,於是刪除mysql.sock檔案後啟動也可以:
[[email protected] html]# mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.back
[[email protected] html]# service mysql51-mysqld start
kill 31011: No such process
Starting mysql51-mysqld:                                   [  OK  ]