Can’t open and lock privilege tables: Table ./mysql/db is marked as crashed

On a Cpanel Server, MySQL did not start. I checked the error log in /var/lib/mysql folder, and found the following error in MySQL log file /var/log/mysqld.log

2023-03-10T18:13:26.405453Z 0 [ERROR] /usr/sbin/mysqld: Table './mysql/db' is marked as crashed and should be repaired
2023-03-10T18:13:26.405465Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/db' is marked as crashed and should be repaired
2023-03-10T18:13:26.405471Z 0 [ERROR] Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files.
2023-03-10T18:13:26.405486Z 0 [ERROR] Aborting

It says “db” table in “mysql” database got corrupted. To fix, I run following

cd /var/lib/mysql/mysql
myisamchk -r db

Now restart MySQL with the command

Advertisement

systemctl restart mysqld
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement