MySQL:Table ‘history_uint’ is marked as crashed and should be repaired

2015年5月14日17:30:45 1 9,250

最近一台zabbix服务器在搬机房后,起来了但是数据都查询不到,查看log发现一段错误日志,数据表被损坏无法读取数据。

16214:20150514:132717.547 [Z3005] query failed: [145] Table './zabbix/history_uint' is marked as crashed and should be repaired [select clock,ns,value from history_uint where itemid=30692 and clock>1431574409 and clock<=1431581237]
16214:20150514:132720.553 [Z3005] query failed: [145] Table './zabbix/history_uint' is marked as crashed and should be repaired [select clock,ns,value from history_uint where itemid=30692 and clock>1431574409 and clock<=1431581240]

解决办法:

mysql有自带的myisamchk 工具会帮助你恢复数据表的索引。

myisamchk工具在mysql文件夹的bin路径下,另外找到报错的/zabbix/history_uint的MYI文件

命令如下:

myisamchk -c -r /usr/local/mysql/var/zabbix/history_uint.MYI

成功后如图显示

MySQL:Table 'history_uint' is marked as crashed and should be repaired

最后重启mysql即可。

 

weinxin
聂扬帆博客
一个分享IT运维相关工作经验和实战技巧的个人博客

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:1   其中:访客  1   博主  0

    • avatar 尚吾网 0

      不止一次的来访,一如既往的支持。