首页 > 数据库 >Linux下yum安装mysql 遇到的问题Can't open and lock privilege tables: Table 'mysql.user' doesn&

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

时间:2022-08-13 18:34:41浏览次数:160  
标签:tables lock doesn exist user mysql open

今天在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

就可以进入了!

标签:tables,lock,doesn,exist,user,mysql,open
From: https://www.cnblogs.com/mandian/p/16583746.html

相关文章