诚招英才(长期):高级测试开发工程师、测试架构师,C++,java,ops; 联系方式:linhan@taobao.com msn: niuxvampire@hotmail.com

解决”Table $table is marked as crashed and should be repaired“

上一篇 / 下一篇  2010-08-11 14:45:36 / 个人分类:DB

今天用mysql时遇到的问题: 51Testing软件测试网*Wcy;@ n$FWN
mysql> select * from $table;51Testing软件测试网]P q%c%`-rp
ERROR 145 (HY000): Table $table is marked as crashed and should be repaired“
UL:b4cK,wAAa0提示表已崩溃,需要修复51Testing软件测试网kw`B}R:R

y-eLomF[0plH0第一次解决:
e;u"?B4S#_q0> ../bin/myisamchk --recover --quick ../mysql/$dbname/$tbName 51Testing软件测试网 @ _)M jxN$PW
--recover   Can fix almost anything except unique keys that aren't unique.51Testing软件测试网9]7FSbd9]v,Sq,c
--quick   Faster repair by not modifying the data file.
2gtkHu!za0修复失败,提示:51Testing软件测试网ld z+udzv
- check record delete-chain51Testing软件测试网 [ x"k9Q!QGfI
- recovering (with sort) MyISAM-table 'clientstatus'51Testing软件测试网w[)T UXE m7K
Data records: 612283
0OfL.mu+W _8Z0- Fixing index 1
io`J4o\8mF^)th6ns5T0Found block that points outside data file at 2922494851Testing软件测试网(d`rVO$bL
MyISAM-table 'clientstatus' is not fixed because of errors
K!]:{'In D.r3CF)r0Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag
O ?0ENP051Testing软件测试网 D2J g2@*Gm#|Op
根据提示继续修复:
?ikO pL0> ../bin/myisamchk --recover --force ../mysql/$dbname/$tbName 51Testing软件测试网(By3i pd X!t
- recovering (with keycache) MyISAM-table 'clientstatus'
eDO5oCY2\0Data records: 61228351Testing软件测试网 i$Do&Y5S yg(R
Found block that points outside data file at 2922494851Testing软件测试网%^7jN4c7mY n%L
修复成功,执行select操作成功51Testing软件测试网L2\{4f;Xl9aGm
51Testing软件测试网N)Uc,y!cX
51Testing软件测试网jtW e9v9fZ \6[

TAG:

 

评分:0

我来说两句

Open Toolbar