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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:40:08
Original
4281 people have browsed it

今天在服务器上另开一个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 
Copy after login

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

mysql_install_db --usrer=mysql --datadir=/var/lib/mysql/newdata
Copy after login

再手工设置一下目录权限

chown mysql.mysql /var/lib/mysql/newdata -R 
Copy after login

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

Related labels:
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template