Linux下yum安装mysql 遇到的问题Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 错误

今天在linux下安装mysql时

执行service mysqld start时, mysql总是启动失败

后来查看mysql日志:/var/log/mysqld.log,发现有个Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 错误

我想可能是mysql.user我安装时没初始化好导致,用下面命令初始化一下数据库就好了

linux初始化数据库:mysql_install_db --user=mysql

执行:

service mysqld restart
mysql -u root -p

就可以进入了!

posted @ 2022-08-13 18:20  漫点  阅读(869)  评论(0编辑  收藏  举报