時間が少しできたので放置していたWordpressのupdateのためにMySQLのバックアップを行ったところエラーが発生してしまいました
mysqldump: Got error: 145: Table ‘./wpdb_rootlinks/wp_wassup’ is marked as crashed and should be repaired when using LOCK TABLES
エラーの内容からWordpressのプラグイン WordPress Wassup Pluginのデータが破損しているようで修復が必要とのこと
なるほど先日から突然Wassup Pluginが機能しなくなったのはこれが原因か
- データベースをチェック
- テーブルの修復
- 再度データベースチェック
念の為に全てのデータベースをチェックしてみます。wpdb_rootlinks.wp_wassupでエラーです
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
; html-script: false ] [root@host01 ~]# mysqlcheck -u root -p --check --all-databases Enter password: (snip) wpdb_rootlinks.wp_wassup_tmp OK wpdb_rootlinks.wp_yarpp_related_cache OK wpdb_rootlinks.wp_wassup warning : Table is marked as crashed and last repair failed warning : 1 client is using or hasn't closed the table properly error : Invalid key block position: 283163870346096694 key block size: 1024 file_length: 35447808 error : key delete-link-chain corrupted error : Corrupt wpdb_rootlinks.wp_wassup_meta OK wpdb_rootlinks.wp_wassup_tmp OK |
テーブルの修復を行いましたがテンポラリファイルが作成できないとのエラーで修復できません
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
; html-script: false ] [root@host01 ~]# mysqlcheck -u root -p --auto-repair --all-databases Enter password: (snip) wpdb_rootlinks.wp_wassup warning : Table is marked as crashed and last repair failed warning : 1 client is using or hasn't closed the table properly error : Invalid key block position: 283163870346096694 key block size: 1024 file_length: 35447808 error : key delete-link-chain corrupted error : Corrupt wpdb_rootlinks.wp_wassup_meta OK wpdb_rootlinks.wp_wassup_tmp OK Repairing tables wpdb_rootlinks.wp_wassup error : Can't create new tempfile: './wpdb_rootlinks/wp_wassup.TMD' status : Operation failed |
改めて調べて再度実行しました。今度は修復できたようです
【参考サイト】
mysql table is marked as crashed and last (automatic?) repair failed
http://stackoverflow.com/questions/8843776/mysql-table-is-marked-as-crashed-and-last-automatic-repair-failed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
; html-script: false ] [root@host01 ~]# cd /var/lib/ [root@host01 lib]# sudo -u mysql myisamchk -r -v -f mysql/wpdb_rootlinks/wp_wassup - recovering (with sort) MyISAM-table 'mysql/wpdb_rootlinks/wp_wassup' Data records: 242274 - Fixing index 1 - Searching for keys, allocating buffer for 161272 keys - Last merge and dumping keys - Fixing index 2 - Searching for keys, allocating buffer for 36153 keys - Last merge and dumping keys - Fixing index 3 - Searching for keys, allocating buffer for 36153 keys - Last merge and dumping keys - Fixing index 4 - Searching for keys, allocating buffer for 12783 keys - Last merge and dumping keys - Fixing index 5 - Searching for keys, allocating buffer for 12783 keys - Last merge and dumping keys - Fixing index 6 - Searching for keys, allocating buffer for 29123 keys - Last merge and dumping keys - Fixing index 7 - Searching for keys, allocating buffer for 29123 keys - Last merge and dumping keys - Fixing index 8 - Searching for keys, allocating buffer for 12332 keys - Last merge and dumping keys - Fixing index 9 - Searching for keys, allocating buffer for 36153 keys - Last merge and dumping keys - Fixing index 10 - Searching for keys, allocating buffer for 36153 keys - Last merge and dumping keys - Fixing index 11 - Searching for keys, allocating buffer for 36153 keys - Last merge and dumping keys - Fixing index 12 - Searching for keys, allocating buffer for 36153 keys - Last merge and dumping keys - Fixing index 13 - Searching for keys, allocating buffer for 12783 keys - Last merge and dumping keys - Fixing index 14 - Searching for keys, allocating buffer for 12783 keys - Last merge and dumping keys - Fixing index 15 - Searching for keys, allocating buffer for 12783 keys - Last merge and dumping keys - Fixing index 16 - Searching for keys, allocating buffer for 12783 keys - Last merge and dumping keys - Fixing index 17 - Searching for keys, allocating buffer for 29123 keys - Last merge and dumping keys - Fixing index 18 - Searching for keys, allocating buffer for 29123 keys - Last merge and dumping keys - Fixing index 19 - Searching for keys, allocating buffer for 29123 keys - Last merge and dumping keys - Fixing index 20 - Searching for keys, allocating buffer for 29123 keys - Last merge and dumping keys |
1 2 3 4 5 6 7 |
; html-script: false ] [root@host01 ~]# mysqlcheck -u root -p --check --all-databases Enter password: (snip) wpdb_rootlinks.wp_wassup OK wpdb_rootlinks.wp_wassup_meta OK wpdb_rootlinks.wp_wassup_tmp OK |
この後に一度Wassup Pluginを無効のあと有効にしてみましたが有効に成らなくてタイムアウトしてしまいました
やはり、修復は不可能なのか….まぁ重要なデータでもないのでWassup Pluginを削除してからテーブルを削除して再度Wassup Pluginをインストールしたところ動作するようになりました
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
; html-script: false ] [root@host01 ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 63365 Server version: 5.5.39 MySQL Community Server (GPL) by Remi Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use wpdb_rootlinks; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> drop table wp_wassup; Query OK, 0 rows affected (20.11 sec) mysql> drop table wp_wassup_meta; Query OK, 0 rows affected (0.01 sec) mysql> drop table wp_wassup_tmp; Query OK, 0 rows affected (0.00 sec) mysql>quit |