导语:今天遇到一个客户的机器,开始提示数据库链接已满,于是重启了服务器,发现mysql启动不起来,提示The server quit without updating PID file的提示,经过一一排查,发生是磁盘已满的问题。
启动mysql提示
[root]# /usr/local/mysql-generic-5.5/support-files/mysql.server start Starting MySQL.The server quit without updating PID file (/[FAILED]data/mysql-generic-5.5/mysql.pid).
使用命令查看空间
当我们查看磁盘空间的时候,发现使用率已经到了100%。
[root]# df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 45G 43G 0 100% / tmpfs 939M 0 939M 0% /dev/shm
找出大于1000M的文件。
find / -type f -size +1000M /home/wwwroot/domain/web/wp-content/debug.log /home/usrdata/mysql-5.6/mysql-bin.000070 /home/usrdata/mysql-5.6/mysql-bin.000052 /home/usrdata/mysql-5.6/mysql-bin.000060 /home/usrdata/mysql-5.6/mysql-bin.000039 /home/usrdata/mysql-5.6/mysql-bin.000069 /home/usrdata/mysql-5.6/mysql-bin.000026 /home/usrdata/mysql-5.6/mysql-bin.000059 /home/usrdata/mysql-5.6/mysql-bin.000033 /home/usrdata/mysql-5.6/mysql-bin.000038 /home/usrdata/mysql-5.6/mysql-bin.000003 /home/usrdata/mysql-5.6/mysql-bin.000028 /home/usrdata/mysql-5.6/mysql-bin.000043 /home/usrdata/mysql-5.6/mysql-bin.000049 /home/usrdata/mysql-5.6/mysql-bin.000044 /home/usrdata/mysql-5.6/mysql-bin.000027 /home/usrdata/mysql-5.6/mysql-bin.000067 /home/usrdata/mysql-5.6/mysql-bin.000066 /home/usrdata/mysql-5.6/mysql-bin.000058 /home/usrdata/mysql-5.6/mysql-bin.000040 /home/usrdata/mysql-5.6/mysql-bin.000029 /home/usrdata/mysql-5.6/mysql-bin.000025
我们把debug.log先删除了,然后关闭日志功能。
打开my.cnf,将 log-bin = mysql-bin 前面加上#。
vi my.cnf net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M #log-bin = mysql-bin binlog_format = mixed server-id = 1 skip-networking [mysqldump] quick [mysql] no-auto-rehash [myisamchk] key_buffer_size = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M
启动mysql
[root]# /usr/local/mysql-5.6/support-files/mysql.server start Starting MySQL. [ OK ]
启动mysql成功
结束
你学会了吗?当然,出现The server quit without updating PID file的错误提示,还有很多种原因,叶子在这里只说了一种,您可以自行百度其他的原因。
只注释#log-bin = mysql-bin 这一条,可能造成mysql启动不了
应该加上这一条binlog_format = mixed
好的,谢谢指导,当时没有遇到过,直接就启动了。