1. 程式人生 > >啟動mysql報錯 -- ERROR! The server quit without updating PID file

啟動mysql報錯 -- ERROR! The server quit without updating PID file

bash cal down tar bsp 二進制 pda you log-bin

開發說某個測試環境的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