1 min read

Drupal Table Crashed! What now? Repair instructions.

I have accidentally crashed my node_revisions table while I was updating an old post today. The error message was huge and at first I panicked... but since I have listened to my own advice I have a backup of my database so it wasn't that bad. Still, restoring a database this large is tedious and, in most cases, unnecessary.

Follow these steps to repair your table if you use PHPMyAdmin:

  1. Log in to PHPMyAdmin.
  2. Click on the database name on the left
  3. Switch to SQL tab
  4. Type in REPAIR TABLE tablename (where tablename is the name of the table that comes up in your error message)
  5. Click Go.

Of course if that fails, I hope that you have your backups up to date ;) .

Naturally, if you're using some other program to manage your database you can still run the REPAIR TABLE command, but you'll need to figure out how to do it all by yourself ;) .