Continuing with the MySQL mini posts I ran into this error today while setting up our redundancy servers. I moved the mysql directory out of it’s default location of /var/lib. So when I went to start Mysql it would fail. When I looked in the /var/log/mysqld.log I seen the following:
Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist
To fix this issue you simply just have to tell mysql where to look not that the default installation is moved. You can do that with:
mysql_install_db –user=mysql –ldata=/newlocation
once you do that you can restart mysql
and that is all.