启动mysql报错 -- ERROR! The server quit without updating PID file

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了启动mysql报错 -- ERROR! The server quit without updating PID file相关的知识,希望对你有一定的参考价值。

开发说某个测试环境的mysql,无法重启了,报以下错误提示:

# service mysqld restart
Shutting down MySQL.. SUCCESS! 
Starting MySQL. ERROR! The server quit without updating PID file (/usr/local/mysql/data/test.pid).
# ps -ef|grep mysql|grep -v grep
avahi      697     1  0 Sep16 ?        00:00:02 avahi-daemon: running [test.local]
# service mysqld start
Starting MySQL. ERROR! The server quit without updating PID file (/usr/local/mysql/data/test.pid).

 

看了一下错误日志,居然没有任何提示。问他重启之前做了什么操作没有,回答说只是开启了二进制,然后尝试重启就报错了。

 

查看了一下my.cnf文件,的确是加了一个参数:

log_bin=binlog

  

但是发现没有设置server-id,于是在配置文件中设置一个server-id:

server-id=1

  

重启成功!

 

错误原因可以从官方文档设置log-bin章节看到:

If you specify this option without also specifying a --server-id, the server is not allowed to start. (Bug #11763963, Bug #56739)

  

 

以上是关于启动mysql报错 -- ERROR! The server quit without updating PID file的主要内容,如果未能解决你的问题,请参考以下文章

启动mysql报错 -- ERROR! The server quit without updating PID file

mysql启动报错:Starting MySQL... ERROR! The server quit without updating PID file

Linux中修改mysql端口之后启动报错 ERROR! The server quit without updating PID file

mysql修改后启动my.cnf报错Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql

MySQL 启动报错:Job for mysqld.service failed because the control process exited with error code.

MySQL 启动报错:Job for mysqld.service failed because the control process exited with error code.