『Table is marked as crashed and should be repaired』の修復方法

MySQLのデータベーステーブルが破損して次のようなエラーが出る場合があります。

#145 - Table './【データベース名】/【テーブル名】' is marked as crashed and should be repaired

check tableで確認すると、破損内容が分かります。

check table `【テーブル名】`;
TableOpMsg_typeMsg_text
【DB名】.【テーブル名】checkwarningTable is marked as crashed
【DB名】.【テーブル名】checkerrorSize of indexfile is: 2539520 Should be: 25...
【DB名】.【テーブル名】checkerrorCorrupt

repair tableで修復をします。

repair table `【テーブル名】`;
【DB名】.【テーブル名】repairinfoKey 1 - Found wrong stored record at 4087792
【DB名】.【テーブル名】repairwarningNumber of rows changed from 20144 to 20094
【DB名】.【テーブル名】repairstatusOK

修復後にcheck tableで調べると、正常に修復されていることを確認できます。

check table `【テーブル名】`;
TableOpMsg_typeMsg_text
【DB名】.【テーブル名】checkstatusOK

関連記事

スポンサーリンク

<BR> 改行する

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る