Mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't
Posted 一谦的视界
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't相关的知识,希望对你有一定的参考价值。
安装mysql后,启动时候没有启动成功,查看了下日志报错如下:---------------------------------------------1 可以:初始化mysql:mysql_install_db
2 目录权限问题chown -R mysql:mysql /var/lib/mysql
[[email protected] local]# less /var/log/mysqld.log
1、查看报错信息如下:
[ERROR] Fatal error: Can‘t open and lock privilege tables: Table ‘mysql.host‘ doesn‘t exist
2、经过查阅资料得知。要敲如下命令解决:
mysql_install_db –usrer=mysql datadir=/var/lib/mysql
datadir是我的mysql存放文件目录
3、然后重启mysql还是不行:
MySQL Daemon failed to start.
正在启动 mysqld: [失败]
4、然后试了下单独的命令,启动完成
mysql_install_db
5、启动mysql服务
[[email protected] mysqld]# /etc/init.d/mysqld restart
停止 mysqld: [确定]
正在启动 mysqld: [确定]
以上是关于Mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't的主要内容,如果未能解决你的问题,请参考以下文章
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.user' d
mysql安转过程中出现的问题! Fatal error: Can't open and lock privilege tables: Table 'mysql.user' d
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn'
Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist(