For some reason, it's not the first thing I think of when diagnosing very strange table errors. I had an issue when doing an order by I'd wind up with only one record. Explain said I should have 28 rows, if I take out the order by I have 28 rows. Well, the problem was table corruption, but unlike some errors where MySQL goes right out and tells you your table is corrupt, I didn't know until I checked it.

I was just wondering if there is a list, or we could make a list of all the times when a MySQL database is corrupted, but you might not necessarily know it is.

link|improve this question

70% accept rate
feedback

2 Answers

Run CHECK TABLE on the table.

link|improve this answer
Yep, that's what I did. I was just wondering if there was a list of warning signs that might give me an indication that I need to run check table – Peter Turner Oct 29 '10 at 18:28
1  
Many people monitor the log results of mysqlcheck regularly (daily, weekly, monthly) as a part of database maintenance. It frees space, optimizes indexes, and is proactive against corruption. – andyh_ky Oct 29 '10 at 20:29
feedback

Fatal errors when trying to read/write to a table is the evidence in most of the cases I've run into.

Also, EXPLAIN only provides an estimated number of rows, so I wouldn't necessarily consider an EXPLAIN output with an unexpected number of rows read/returned as an indication of table corruption.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.