我今天早上醒来发现我的个人 CentOs 服务器上的 MySQL 已关闭,但我似乎无法重新启动它?!?
开始(好吧重新启动...):
root@tent:~$ /sbin/service mysqld restart
ERROR! MySQL manager or server PID file could not be found!
Starting MySQL............................................................................................................... ERROR! Manager of pid-file quit without updating
root@tent:~$ /sbin/service mysqld status
ERROR! MySQL is running but PID file could not be found
错误日志的尾部(无相关内容)
tail -f /var/lib/mysql/tent.err
110302 12:43:39 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.55' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server
110305 17:52:04 mysqld_safe mysqld from pid file /var/lib/mysql/tent.pid ended
尝试安全模式:
/usr/bin/mysqld_safe
120502 08:01:54 mysqld_safe Logging to '/var/lib/mysql/mysql-bin.err'.
120502 08:01:54 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120502 08:03:38 mysqld_safe mysqld from pid file /var/lib/mysql/tent.pegproductions.com.pid ended
因此我让这些继续运行,但是 MySQL 仍然处于“关闭”状态(phpMyAdmin 失败,PHP Web 应用程序也失败)。
root@tent:/var/lib/mysql$ ps aux | grep -i mysql
root 1599 0.0 0.0 3712 1308 ? S Apr30 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/tent.pid
mysql 1666 0.0 0.9 130000 19356 ? Sl Apr30 0:08 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/mysql-bin.err --pid-file=/var/lib/mysql/tent.pid
root 11452 0.0 0.0 3224 776 pts/0 S+ 08:07 0:00 grep -i mysql
据我所知,我没有改变任何东西,但它不再启动了?
您知道原因吗?或者我可以提供哪些更多信息?
root@tent:~$ file /var/lib/mysql/tent.pid
/var/lib/mysql/tent.pid: ASCII text
root@tent:~$ cat /var/lib/mysql/tent.pid
1672
答案1
请尝试以下操作:
kill -15 1666
kill -15 1599
rm /var/lib/mysql/tent.pid
rm /var/lib/mysql/tent.pegproductions.com.pid
service mysqld start