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

啟動mysql報錯:ERROR! The server quit without updating

mysql

啟動mysql報錯:ERROR! The server quit without updating PID file (/data/mysql/localhost.localdomain.pid),查看mysql.log發現報錯信息:
[ERROR] Fatal error: Can‘t open and lock privilege tables: Table ‘mysql.host‘ doesn‘t exist

解決方案:
scripts/mysql_install_db --user=mysql --datadir=/data/mysql
之前寫成:scripts/mysql_install_db --user=mysql --datadir=/data/mysql basedir=/usr/local/mysql

需要去掉basedir=/usr/local/mysql才行
另外需要再/etc/my.cnf 加上datadir=/data/mysql

啟動mysql報錯:ERROR! The server quit without updating