MYSQLのテーブル破損 修復方法
これも助かった。
MYSQLのチェック、修復コマンドって結構あるのね。
こうなると
■参照先
http://www.syncworld.net/blog/nob/archives/mysql.html
mysql> check table mt_comment quick; +--------------------+-------+----------+--------------------------------------------------------+ | Table | Op | Msg_type | Msg_text | +--------------------+-------+----------+--------------------------------------------------------+ | xxxxxxx.mt_comment | check | warning | 4 clients is using or hasn't closed the table properly | | xxxxxx.mt_comment | check | status | OK | +--------------------+-------+----------+--------------------------------------------------------+ あやしいので、quickチェックからextendedに切り替えて再度。 mysql> check table mt_comment extended; +--------------------+-------+----------+----------------------------------+ | Table | Op | Msg_type | Msg_text | +--------------------+-------+----------+----------------------------------+ | xxxxxx.mt_comment | check | warning | Table is marked as crashed | | xxxxxx.mt_comment | check | error | Found too long record at 2925500 | | xxxxxx.mt_comment | check | error | Corrupt | +--------------------+-------+----------+----------------------------------+ ということで、repairコマンドで、テーブルの修復を実行。 mysql> repair table mt_comment ; +--------------------+--------+----------+-------------------------------------------------------+ | Table | Op | Msg_type | Msg_text | +--------------------+--------+----------+-------------------------------------------------------+ | xxxxxx.mt_comment | repair | info | Found block with too small length at 2925500; Skipped | | xxxxxx.mt_comment | repair | info | Found block with too small length at 3445396; Skipped | | xxxxxx.mt_comment | repair | info | Wrong bytesec: 45-101-109 at 4124404; Skipped | | xxxxxx.mt_comment | repair | warning | Number of rows changed from 23143 to 23112 | | xxxxxx.mt_comment | repair | status | OK | +--------------------+--------+----------+-------------------------------------------------------+