Mokka mit Schlag is Back

Sometime over the last couple of weeks while I was in Cuba, MySQL corrupted the wp_posts table in my WordPress database. At first I thought I was hacked, but it looks like the database was just corrupted:

mysql> check table wp_posts;
+---------------------------+-------+----------+----------------------------------------------------------------------------------+
| Table                     | Op    | Msg_type | Msg_text                                                                         |
+---------------------------+-------+----------+----------------------------------------------------------------------------------+
| elharo_wordpress.wp_posts | check | warning  | Table is marked as crashed                                                       | 
| elharo_wordpress.wp_posts | check | warning  | Size of indexfile is: 1148225      Should be: 467968                             | 
| elharo_wordpress.wp_posts | check | error    | Can't read indexpage from filepos: 56320                                         | 
| elharo_wordpress.wp_posts | check | Error    | Incorrect key file for table './elharo_wordpress/wp_posts.MYI'; try to repair it | 
| elharo_wordpress.wp_posts | check | error    | Corrupt                                                                          | 
+---------------------------+-------+----------+----------------------------------------------------------------------------------+
5 rows in set (0.00 sec)

mysql> repair table wp_posts;
+---------------------------+--------+----------+----------+
| Table                     | Op     | Msg_type | Msg_text |
+---------------------------+--------+----------+----------+
| elharo_wordpress.wp_posts | repair | status   | OK       | 
+---------------------------+--------+----------+----------+
1 row in set (0.34 sec)

mysql> check table wp_posts;
+---------------------------+-------+----------+----------+
| Table                     | Op    | Msg_type | Msg_text |
+---------------------------+-------+----------+----------+
| elharo_wordpress.wp_posts | check | status   | OK       | 
+---------------------------+-------+----------+----------+
1 row in set (0.08 sec)

I think I’ve fixed this now, but do let me know if you see any lingering problems. Hmm, it does look like the categories may be borked too. I’ll look at that next.

Yep. Categories were broken too:


mysql> check table wp_term_taxonomy;
+-----------------------------------+-------+----------+------------------------------------------------------------------------------------------+
| Table                             | Op    | Msg_type | Msg_text                                                                                 |
+-----------------------------------+-------+----------+------------------------------------------------------------------------------------------+
| elharo_wordpress.wp_term_taxonomy | check | warning  | Size of indexfile is: 818482      Should be: 17408                                       | 
| elharo_wordpress.wp_term_taxonomy | check | error    | Can't read indexpage from filepos: 6144                                                  | 
| elharo_wordpress.wp_term_taxonomy | check | Error    | Incorrect key file for table './elharo_wordpress/wp_term_taxonomy.MYI'; try to repair it | 
| elharo_wordpress.wp_term_taxonomy | check | error    | Corrupt                                                                                  | 
+-----------------------------------+-------+----------+------------------------------------------------------------------------------------------+
4 rows in set (0.00 sec)

mysql> repair table wp_term_taxonomy;
+-----------------------------------+--------+----------+----------+
| Table                             | Op     | Msg_type | Msg_text |
+-----------------------------------+--------+----------+----------+
| elharo_wordpress.wp_term_taxonomy | repair | status   | OK       | 
+-----------------------------------+--------+----------+----------+
1 row in set (0.02 sec)

mysql> check table wp_term_taxonomy;
+-----------------------------------+-------+----------+----------+
| Table                             | Op    | Msg_type | Msg_text |
+-----------------------------------+-------+----------+----------+
| elharo_wordpress.wp_term_taxonomy | check | status   | OK       | 
+-----------------------------------+-------+----------+----------+
1 row in set (0.00 sec)

Leave a Reply