Recently I got the following error while working on a php and mysql based application – Table is marked as crashed and should be repaired

This error can be easily fixed by doing a repair operation on the table. Repair can be performed in two ways.

  • Using PHP MyAdmin GUI
  • Using command line

In the Phpmyadmin GUI, select the table which has the problem and select the operation repair. This will perform a repair operation.

Using command line, execute the following command in the MySQL terminal.

USE database_name;
REPAIR TABLE table_name;

This will solve the issue.