重启MySQL数据库服务器提示ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql),看了下MySQL数据库状态:
1
2
|
# 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成功:
1
2
3
4
5
|
# 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服务不能启动等等故障:
1
2
|
[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/目录下
1
2
3
4
5
6
|
[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
本文转自 boy461205160 51CTO博客,原文链接:http://blog.51cto.com/461205160/1731369