{"id":1004208,"date":"2012-04-08T14:16:32","date_gmt":"2012-04-08T19:16:32","guid":{"rendered":"http:\/\/www.elharo.com\/blog\/?p=1004208"},"modified":"2012-04-08T14:19:21","modified_gmt":"2012-04-08T19:19:21","slug":"mokka-mit-schlag-is-back","status":"publish","type":"post","link":"https:\/\/www.elharo.com\/blog\/software-development\/databases\/2012\/04\/08\/mokka-mit-schlag-is-back\/","title":{"rendered":"Mokka mit Schlag is Back"},"content":{"rendered":"<p>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:<\/p>\n<pre><code>mysql> check table wp_posts;\r\n+---------------------------+-------+----------+----------------------------------------------------------------------------------+\r\n| Table                     | Op    | Msg_type | Msg_text                                                                         |\r\n+---------------------------+-------+----------+----------------------------------------------------------------------------------+\r\n| elharo_wordpress.wp_posts | check | warning  | Table is marked as crashed                                                       | \r\n| elharo_wordpress.wp_posts | check | warning  | Size of indexfile is: 1148225      Should be: 467968                             | \r\n| elharo_wordpress.wp_posts | check | error    | Can't read indexpage from filepos: 56320                                         | \r\n| elharo_wordpress.wp_posts | check | Error    | Incorrect key file for table '.\/elharo_wordpress\/wp_posts.MYI'; try to repair it | \r\n| elharo_wordpress.wp_posts | check | error    | Corrupt                                                                          | \r\n+---------------------------+-------+----------+----------------------------------------------------------------------------------+\r\n5 rows in set (0.00 sec)\r\n\r\nmysql> repair table wp_posts;\r\n+---------------------------+--------+----------+----------+\r\n| Table                     | Op     | Msg_type | Msg_text |\r\n+---------------------------+--------+----------+----------+\r\n| elharo_wordpress.wp_posts | repair | status   | OK       | \r\n+---------------------------+--------+----------+----------+\r\n1 row in set (0.34 sec)\r\n\r\nmysql> check table wp_posts;\r\n+---------------------------+-------+----------+----------+\r\n| Table                     | Op    | Msg_type | Msg_text |\r\n+---------------------------+-------+----------+----------+\r\n| elharo_wordpress.wp_posts | check | status   | OK       | \r\n+---------------------------+-------+----------+----------+\r\n1 row in set (0.08 sec)\r\n<\/code><\/pre>\n<p>I think I&#8217;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&#8217;ll look at that next.<br \/>\n<!--more--><\/p>\n<p>Yep. Categories were broken too:<\/p>\n<pre><code>\r\nmysql> check table wp_term_taxonomy;\r\n+-----------------------------------+-------+----------+------------------------------------------------------------------------------------------+\r\n| Table                             | Op    | Msg_type | Msg_text                                                                                 |\r\n+-----------------------------------+-------+----------+------------------------------------------------------------------------------------------+\r\n| elharo_wordpress.wp_term_taxonomy | check | warning  | Size of indexfile is: 818482      Should be: 17408                                       | \r\n| elharo_wordpress.wp_term_taxonomy | check | error    | Can't read indexpage from filepos: 6144                                                  | \r\n| elharo_wordpress.wp_term_taxonomy | check | Error    | Incorrect key file for table '.\/elharo_wordpress\/wp_term_taxonomy.MYI'; try to repair it | \r\n| elharo_wordpress.wp_term_taxonomy | check | error    | Corrupt                                                                                  | \r\n+-----------------------------------+-------+----------+------------------------------------------------------------------------------------------+\r\n4 rows in set (0.00 sec)\r\n\r\nmysql> repair table wp_term_taxonomy;\r\n+-----------------------------------+--------+----------+----------+\r\n| Table                             | Op     | Msg_type | Msg_text |\r\n+-----------------------------------+--------+----------+----------+\r\n| elharo_wordpress.wp_term_taxonomy | repair | status   | OK       | \r\n+-----------------------------------+--------+----------+----------+\r\n1 row in set (0.02 sec)\r\n\r\nmysql> check table wp_term_taxonomy;\r\n+-----------------------------------+-------+----------+----------+\r\n| Table                             | Op    | Msg_type | Msg_text |\r\n+-----------------------------------+-------+----------+----------+\r\n| elharo_wordpress.wp_term_taxonomy | check | status   | OK       | \r\n+-----------------------------------+-------+----------+----------+\r\n1 row in set (0.00 sec)\r\n\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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; +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+ | Table | Op | Msg_type | Msg_text | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+ | elharo_wordpress.wp_posts | [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,10],"tags":[],"class_list":["post-1004208","post","type-post","status-publish","format-standard","hentry","category-blogging","category-databases"],"_links":{"self":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1004208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/comments?post=1004208"}],"version-history":[{"count":6,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1004208\/revisions"}],"predecessor-version":[{"id":1004214,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1004208\/revisions\/1004214"}],"wp:attachment":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/media?parent=1004208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/categories?post=1004208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/tags?post=1004208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}