mysql数据库表损坏出现Incorrect key file for table的修复解决方法 -云主机博士

PikPak安卓最新版APP v1.46.2_免费会员兑换邀请码【508001】可替代115网盘_全平台支持Windows和苹果iOS&Mac_ipad_iphone -云主机博士 第1张

推荐阅读:

[AI-人工智能]免翻墙的AI利器:樱桃茶·智域GPT,让你轻松使用ChatGPT和Midjourney - 免费AIGC工具 - 拼车/合租账号 八折优惠码: AIGCJOEDISCOUNT2024

[AI-人工智能]银河录像局: 国内可靠的AI工具与流媒体的合租平台 高效省钱、现号秒发、翻车赔偿、无限续费|95折优惠码: AIGCJOE

[AI-人工智能]NexGenAI - 您的智能助手,最低价体验ChatGPT Plus共享账号

[AI-人工智能]边界AICHAT - 超级永久终身会员激活 史诗级神器,口碑炸裂!300万人都在用的AI平台

今天查询mysql的时候,报这样的错误,Incorrect key file for table ‘./yunzhujiboshi/hello.MYI’; try to repair it. mysql表损坏的情况是很少见的,下面的方法适用于myisam,其他存储引擎,不知道能不能这样修复。

1,myisamchk修改表。首先先cd切换到出错数据库的表名所在的目录下

    [root@localhost yunzhujiboshi]# myisamchk -of ./hello.MYI     //修复第一步
    – recovering (with keycache) MyISAM-table ‘./hello.MYI’
    Data records: 12597637
    Found block that points outside data file at 1630252996
    Data records: 12597456
    [root@localhost yunzhujiboshi]# myisamchk -r ./hello.MYI     //修复第二步
    – recovering (with sort) MyISAM-table ‘./hello.MYI’
    Data records: 12597456
    – Fixing index 1
    [root@localhost yunzhujiboshi]# myisamchk ./hello.MYI     //修复第三步

    Checking MyISAM file: ./hello.MYI
    Data records: 12597456   Deleted blocks:       0
    – check file-size
    – check record delete-chain
    – check key delete-chain
    – check index reference
    – check data record references index: 1
    – check record links

myisamchk带的参数,可以用man看一下。操作后重新启动一下数据库。

    [root@localhost yunzhujiboshi]# /etc/init.d/mysqld restart

这样操作后,还是有问题,会报 #145 – Table “XXXXX” is marked as crashed and should be repaired。如下图:

mysql数据库表损坏出现Incorrect key file for table的修复解决方法 -云主机博士 第1张
myisamchk 修复表后报的错误

2,命令行下repair修复表

    mysql> repair table hello;  //hello是表名

如下图
mysql数据库表损坏出现Incorrect key file for table的修复解决方法 -云主机博士 第2张

到这儿,myisam表损坏就修复好了。

宝塔服务器面板,一键全能部署及管理,送你3188元礼包,点我领取


iproyal.png
原文链接:,转发请注明来源!
「mysql数据库表损坏出现Incorrect key file for table的修复解决方法 -云主机博士」评论列表

发表评论