How to Repair a Crashed MySQL Table

MySQL Tables Can Crash!

I didn’t know until it happened to me recently, but MySQL tables can crash. When one of my tables crashed the first I knew about it was when I tried to browse it using phpMyAdmin and received an error message.

Repair a MySQL Table

My first through was to use the “Repaid table” link that is available under phpMyAdmin’s “Table maintenence” section. Unfortunately once the table has crashes it’s not possible to access that link!

After a bit of searching I located the underlying SQL query that you can run to repair a crashed MySQL table:

REPAIR TABLE `table_name`;

That line of SQL got my MySQL table back up and running again straight away.

Useful Links

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Note: if you want to post PHP or ASP code including the opening tags (<?php etc...) you must use the HTML entity for the left chevron (<) - &lt; - or your code will be stripped out!