虎泰克博客

数据库出现错误启动不了ERROR! MySQL server PID file could not be found!的解决方法


最近老是碰到数据库无缘无故崩了导致网站访问不了SSH执行/etc/init.d/mysql star

最近老是碰到数据库无缘无故崩了导致网站访问不了SSH执行/etc/init.d/mysql start时却又无法启动MySQL 错误信息如下: ERROR! MySQL server PID file could not be found! Starting MySQL.. ERROR! The server quit without updating PID file 启动会报错Starting MySQL.. ERROR! The server quit without updating PID file (/var/local/mysql/var/AYxxxxxxx.pid) 原因一:二进制日志文件占满磁盘空间 在网上百度了一下原来是因为 mysql-bin.0000*的文件占满系统盘,磁盘空间不足导致无法写入。 解决方法: 1:删除所有mysql-bin.0000*日志文件全部rm掉 2:修改在my.cnf 文件,找到 log-bin=mysql-bin 将其启注释掉,以后就不会产生2进制的mysql-bin.0000*的日志文件 原因二:mysqld进程卡死 [root@centos var]# service mysqld stop MySQL manager or server PID file could not be found! [FAILED] 解决办法: 首先查看一下进程 [root@centos mysql]# ps aux |grep mysq* root 2643 0.0 0.2 4536 1224 ? S 01:09 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/centos.pid mysql 2757 0.0 1.2 36976 6608 ? Sl 01:09 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --log-error=/usr/local/mysql/var/centos.err --pid-file=/usr/local/mysql/var/centos.pid --socket=/tmp/mysql.sock --port=3306 root 4788 0.0 0.1 3920 684 pts/2 R+ 11:11 0:00 grep mysq* 如果看到上面的内容,那说明,Mysql的进程卡死了,这时用就要把这些卡死的进程都关闭 [root@centos mysql]# kill 2643 [root@centos mysql]# kill 2757 启动Mysql 就ok了 [root@centos mysql]# service mysqld start Starting MySQL.


Statement: all articles / drawings reproduced on this website are for the purpose of transmitting more information and facilitating discussion, which does not mean that the website, the host and the organizer agree with their opinions or confirm the authenticity of their contents. The contents of the articles are for reference only. If the rights of the original author are violated, please contact the website administrator.

Sign in to comment

Comment list

    No data