[MySQL] 重启MySQL提示ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql)
重启MySQL数据库服务器提示ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql),看了下MySQL数据库状态:
# service mysql status ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
接着查看了下MySQL的错误日志看到:
/usr/sbin/mysqld: unknown option ‘--safe-show-database‘
所以应该是my.cnf文件中配置出错了,将这行给去掉之后重启MySQL成功:
# service mysql restart ERROR! MySQL server PID file could not be found! Starting MySQL.. SUCCESS! # service mysql status SUCCESS! MySQL running (4040)
配置文件my.cnf 丢失,导致mysql服务不能启动等等故障:
[root@centos6 init.d]# service mysqld start Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql/centos6.pid).
重新拷贝正确my.cnf配置文件到/etc/目录下
[root@centos6 mysql]# cp support-files/my-large.cnf /etc/my.cnf cp:是否覆盖"/etc/my.cnf"? y [root@centos6 mysql]# service mysqld start Starting MySQL.... SUCCESS! [root@centos6 mysql]# service mysqld status SUCCESS! MySQL running (50035)
运行ok
本文出自 “boyhack” 博客,请务必保留此出处http://461205160.blog.51cto.com/274918/1731369
文章来自:http://461205160.blog.51cto.com/274918/1731369