记录一次数据库修复

当遇到'MySQL Table is marked as crashed and should be repaired'的错误时,可以按照以下步骤进行修复:1. 停止MySQL服务;2. 使用myisamchk工具尝试-r和-f选项修复;3. 如果遇到myisam_sort_buffer_size过小的问题,可以通过增加排序缓存大小解决。通过这些操作,成功修复了数据库表。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

程序报错

          Table '.xxxx' is marked as crashed and should be repaired

1.首先关闭mysql服务

service stop mysql

2.使用mysiamchk修复

root@10-10-74-251:/data/mysql_data/cmd5# myisamchk -r -f  t_counter.MYI

– recovering (with sort) MyISAM-table ‘t_counter.MYI
Data records: 0
– Fixing index 1
myisamchk: error: myisam_sort_buffer_size is too small
MyISAM-table ‘md5_core.MYI’ is not fixed because of errors

Try fixing it by using the –safe-recover (-o), the –force (-f) option or by not using the –quick (-q) flag

myisamchk -r -f  t_counter.MYI --s

3.修复时发现报:  myisam_sort_buffer_size is too small,在修复命令后面加参数,增大排序缓存,修复成功

     myisamchk -r -f  t_counter.MYI   --sort_buffer_size=10G

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值