Back to Top

How To Repair MySQL Table


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?

Well, Don’t worry because you need to repair your table.REPAIR is to repair a crashed or corrupted table.One more important thing is we can repair table if its storage engine is MYISAM or ARCHIVE.

If you are using InnoDB, restore the table from a backup. The common reason behind InnoDB table crashed if the lack of disk space.

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!

Hope, This article help you if any crash occurs in your more thing sometimes the repair query doesn’t repair the database so you need to use MySQL recovery Software.

At last, Take Backup of your data often and be relax 🙂

Comments (1)

  1. I could read a book about this wtoihut finding such real-world approaches!

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

How to use HTML5 download attribute?

Posted on 4 years ago


What is DocType In HTML

Posted on 7 years ago


Problem with German special character

Posted on 7 years ago


What is Final keyword in PHP

Posted on 7 years ago


Hello world

Updated 1 month ago

Nick Carter

In depth Understanding of Laravel Core

Updated 3 months ago


ECMAScript 6 New Features – 2

Updated 1 year ago


The Reader’s Poll – August 2014

Posted on 5 years ago


The Reader’s Poll – June 2014

Posted on 5 years ago


The Readers’ Poll – May 2014

Posted on 5 years ago