How to repair crashed tables in MySQL
Submitted by specialj on Fri, 12/21/2007 - 05:55.
I’ve had MySQL database corruption from time to time, usually on a system that either experiences a power failure or kernel panic. The process is not difficult but I always find myself relearning how to do it each time. The program mysqlcheck comes in handy to check for errors and repair them.
The error that was reported recently when I did this was “Table ‘[SOME TABLE NAME]’ is marked as crashed and should be repaired”. The command I used to repair the problem (and that I believe I’ve used int he past) was:
mysqlcheck -A --auto-repair
This provides a pretty good status report as to what tables have issues, what the issues are, and what it does to fix them. For example it might read something like “warning : Number of rows changed from 5 to 4”.




Recent comments
8 weeks 4 days ago
12 weeks 1 day ago
13 weeks 6 days ago
14 weeks 2 days ago
17 weeks 3 days ago
22 weeks 1 day ago
27 weeks 15 hours ago
30 weeks 5 days ago
36 weeks 1 day ago
37 weeks 5 days ago