Checking and Repairing Database Tables
The general procedure for table damage detection and correction is as follows:
Check the table for errors.
If the table checks okay, you're done. Otherwise, you must repair it.
Make copies of the table files before beginning repair, just in case something goes wrong.
Try to repair the table.
If the repair operation fails, restore the table from your database backups and update logs.
The final step of the preceding procedure assumes that you've been performing database backups and have update logging enabled. If that's not true, you're living dangerously. Go read Chapter 11, "General MySQL Administration," to find out how to use mysqldump and how to turn on update logging. You don't ever want to be in the position ...