Neo Inspiration

Avatar

中の人:jakkrokk (HN統一しました) がphp,javascript,air,flex などなど好き勝手書いてます。仕事は主にWEBシステムの設計と開発、SEO全般など。

Mysql がクラッシュ?

いきなり朝DBが落ちて 何事かと思ったら
どうもMYSQLがぶっ壊れたらしい。。。

myisamchk を走らせて

myisamchk /var/lib/mysql/*****
Checking MyISAM file: /var/lib/mysql/*****
Data records: 1996837 Deleted blocks: 0
myisamchk: warning: Table is marked as crashed
myisamchk: warning: 1 client is using or hasn’t closed the table properly
- check file-size
- check record delete-chain
- check key delete-chain
- check index reference
- check data record references index: 1
myisamchk: error: Key in wrong position at page 16121856
- check record links
myisamchk: error: Found wrong record at 147693548
MyISAM-table ‘/var/lib/mysql/***’ is corrupted
Fix it using switch “-r” or “-o”

こんな感じででてきた。

結果から言えば インデックス張りなおしで終わったのだけど

Table is marked as crashed

とかでるとあせりますw

どうもプログラム上でテーブルをつかみっぱなしだったっぽいですね。
アクセステーブルだけに秒単位でクエリが投げられてるわけですが
こんなことは初めて。

原因はこれから調査することになるわけですが、
プログラムで回避できるものなのだろうか。。

No Comments, Comment or Ping

Twitter