If your table crashed, your websites stop working and if your website’s main content is coming from that crashed table, you might feel the tension.what now?. Am I right?
You can see one of the useful information that is How to avoid to use ENUM and SET type in MySQL
It’s might take the time to repair the table that depends upon a size of tables. It takes few seconds to repair few KB table, and Its takes few minutes to repair for a few MB table and can take hours if the table is in a few GB. To restore huge table better option is to restore it from backup but if you don’t have the backup we can restore it but you need to face long repair process.
Here is the Syntax REPAIR TABLE
REPAIR TABLE table_name [, table_name ...]
REPAIR TABLE works only on Storage Engine such as MyISAM and for each repaired table you can get many rows of information after optimizing database tables.The InnoDB table can not be recovered as it does not support the recovery.
NOTES: It is better to take the backup of the table before you repair the table because if the repair fails, can lead to data loss.
Let’s move to repairing a table.
To repair a table you can directly apply a query like:
repair table my_crashed_table;
And if you don’t want to do it with query, you can do it from PHPMyAdmin by following steps
PHPMyAdmin >> select the database >> select the table >> select the "Repair table" menu at the bottom and the crashed table should be repaired
Described steps of PHPMyAdmin are fortunately easy and quick so non-technical readers can also resolve the issue quickly and easily and everything must be restored!
At last, Take Backup of your data often and be relax 🙂