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

mysql-logo

Ran into a mysql issue at work today after an unplanned power outage took the server down. The error was Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist” everytime we tried to start mysql. Looked like the system tables were gone.

The fix;

We recreated the system tables in the mysql data directory using mysql_install_db.

mysql_install_db –user=mysql –ldata=/mysql-data/location

Restart mysql and you should be good to go.

© 2008-2012 The Danesh Project
Powered by Wordpress and made by Guerrilla. Hosted at ServerFreak