![mysql 服务突然停止工作](https://linux22.com/image/716172/mysql%20%E6%9C%8D%E5%8A%A1%E7%AA%81%E7%84%B6%E5%81%9C%E6%AD%A2%E5%B7%A5%E4%BD%9C.png)
我突然无法启动 mysql 服务
/etc/init.d/mysql start
Starting MySQL...... ERROR! The server quit without updating PID file (/var/lib/mysql/mysql.pid).
我尝试过以下操作,但仍然无效
chmod -R 777 /var/lib/mysql
我可以跑mysqld_safe
180114 23:05:07 mysqld_safe Logging to '/var/lib/mysql-error/mysql-error.err'.
180114 23:05:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
180114 23:05:11 mysqld_safe mysqld from pid file /var/lib/mysql/mysql.pid ended
但是当我检查状态时收到以下消息
[root@host ~]# service mysql status
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
答案1
以防万一,请确保你的 mysql不是正在运行:ps uax | grep mysql
。如果没有 — 只需删除锁定文件:rm /var/lock/subsys/mysql
。
然后你应该就能正常重启mysql了。