Wednesday 31 January 2018

Error: Table is marked as crashed and should be repaired

If you are getting the following error message:

[ERROR] /usr/libexec/mysqld: Table './TestDB/TestTable' is marked as crashed and last (automatic?) repair failed

One or more tables have been corrupted or crashed in MySQL database due to which the application or user are not able to access the database.

How to repair a MySQL table:

To fix the problem we need to log into MySQL and select necessary database and run the below command:

mysql> USE TestDB;
mysql> REPAIR TABLE TestTable;
mysql> select * from TestTable;

The above command will repair the corrupted table TestTable in TestDB database.

No comments:

Post a Comment