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