启动MySQL报Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

今天在服务器上另开一个MySQL,新建一个配置文件修改了端口,存放目录后,服务起不来,查看错误日志发现错误行

Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 

检查数据目录,发现mysql目录没有被创建,手动执行脚本

mysql_install_db --usrer=mysql --datadir=/var/lib/mysql/newdata

再手工设置一下目录权限

chown mysql.mysql /var/lib/mysql/newdata -R 

重新开启MySQL服务,运行正常

Popularity: 5% [?]

Random Posts

Comments

Leave a Reply