linux 服务器安装mysql之后,重启 Mysql 有可能会经常碰到这样的错误提示:
MySQL server PID file could not be found! [失败]
[root@localhost local]# MySQL server PID file could not be found!
反正我是经常碰到这样的情况,有些 reboot 重启下服务器就恢复了。
但是大部分情况可能是进程的问题。
首先输入查询命令:
[root@localhost ~]# ps aux |grep mysq*
root 1763 0.0 0.1 108352 1304 ? S 01:01 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.pid
mysql 1905 0.1 39.1 791004 396364 ? Sl 01:01 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/lib/mysql/localhost.err --pid-file=/var/lib/mysql/localhost.pid
如果看到上面的内容,那说明,Mysql 的进程卡死了,这时用就要把这些卡死的进程都关闭。
执行以下命令:
[root@localhost local]# kill 1763
[root@localhost local]# kill 1905
然后重启 mysql
[root@localhost local]# service mysql start
Starting MySQL [确定]