Home  >  Article  >  Database  >  启动MySQL报Fatal error: Can’t open and lock privilege

启动MySQL报Fatal error: Can’t open and lock privilege

WBOY
WBOYOriginal
2016-06-07 16:40:084181browse

今天在服务器上另开一个MySQL,新建一个配置文件修改了端口,存放目录后,服务起不来,查看错误日志发现错误行 Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 检查数据目录,发现mysql目录没有被创建,手动执行脚本

今天在服务器上另开一个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服务,运行正常

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn