Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist的解决方法

时间:2021-07-05 08:20:35

安装完Mysql5.5.24时,用mysql.server启动的时候,出现

Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

最终解决方法如下:

在mysql的安装目录下,我的是/home/work/ss/mysql,在cmake配置时设置的datadir为home/work/mysql/data

./scripts/mysql_install_db   --usrer=mysql  --datadir=/home/work/ss/mysql/data/

原因是重装的时候数据目录不一致导致

然后再次启动,OK