Mohan Cheema's Online Diary

Site Just to Keep Track of My Day to Day Work.

Can’t open and lock privilege tables: Table ‘mysql.db’ doesn’t exist

| 0 comments

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

I faced this problem while I was shifting the location of mysql data directory to non-default location. I copied all the files from /var/lib/mysql(default data location) to the /data and changed path in /etc/my.cnf also.

When i tried to run the mysql service, It gave following error in /var/log/mysql/mysql.err

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

It seems like service was not able to locate some table in MySQL DB. Did few searches and found a solution:

Install MySQL DB again at new location,use following command:

mysql_install_db --user=mysql --ldata=/data
/etc/init.d/mysql restart

I hope this will save your time.

Share

Author: Mohan Cheema

I am a Commerce Graduate currently I am working as Senior Support Analyst (Linux Administrator) with medium sized MNC Company. If time permits I do freelance work like setting up the servers as per the requirement, do performance tuning and so on.

Leave a Reply

Required fields are marked *.

*

* Copy this password:

* Type or paste password here:

2,952 Spam Comments Blocked so far by Spam Free Wordpress


CommentLuv badge

Notify me of followup comments via e-mail. You can also subscribe without commenting.