Data corruption! It can happen. Maybe because of a bug or storage problem that you didn’t expect, or MySQL crashes when a page checksum’s result is different from what it expected. Either way, corrupted data can and does occur. What do you do then?
Let’s look at the following example and see what can be done when you face this situation.
We have some valuable data:
> select * from t limit 4; +---+--------+ | i | c | +---+--------+ | 1 | Miguel | | 2 | Angel | | 3 | Miguel | | 4 | Angel | +---+--------+ > select count(*) from t; +----------+ | count(*) | +----------+ | 2097152 | +----------+
One day the query you usually run fails and your application stops working. Even worse, it causes the crash already mentioned:
> select * from t where i=2097151; ERROR 2006 (HY000): MySQL server has gone away
Usually this is the point when panic starts. The error log shows: …
[Read more]