1. 程式人生 > >Mysql啟報錯報The server quit without updating PID file

Mysql啟報錯報The server quit without updating PID file

oca use log pre user ado 1.5 tle 分享

mysql 安裝時候安裝後啟動不成功報錯:

Starting MySQL.. ERROR! The server quit without updating PID file (/data/mysql/26765574162f.pid).

技術分享圖片


查看報錯日誌:

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

技術分享圖片


解決辦法:


1.編輯配置文件:

vim /etc/my.cnf
basedir = /usr/local/mysql
datadir = /data/mysql
socket = /tmp/mysql.sock
log-error = /data/mysql/error.log
pid-file = /data/mysql/mysql.pid
user = mysql
tmpdir = /tmp

2.重新初始化mysql:

./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql --pid-file=/data/mysql/mysql.pid --tmpdir=/tmp

然後再啟動就會成功了:

技術分享圖片


Mysql啟報錯報The server quit without updating PID file