启动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
转载于:https://blog.51cto.com/13617057/2095849