记录一次mysql数据库文件损坏导致数据库崩溃

1 篇文章 0 订阅
1 篇文章 0 订阅

表现:

服务器数据库查询很慢,莫名数据库服务崩溃

问题排查过程:

按照网上操作,配置my.ini ,添加error-log参数,重启mysql,查看错误日志

按照错误日志内容,搜索可能的错误问题

比如我的报错是:

221026 14:35:35 [Note] C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin\mysqld: ready for connections.
Version: '5.5.35-log'  socket: ''  port: 3306  MySQL Community Server (GPL)
InnoDB: Error: trying to access page number 4294851967 in space 0,
InnoDB: space name .\ibdata1,
InnoDB: which is outside the tablespace bounds.
InnoDB: Byte offset 0, len 16384, i/o type 10.
InnoDB: If you get this error at mysqld startup, please check that
InnoDB: your my.cnf matches the ibdata files that you have in the
InnoDB: MySQL server.
221026 14:37:09  InnoDB: Assertion failure in thread 10012 in file fil0fil.c line 4578
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.

几乎每隔1分钟,mysql重启一次

解决方案是说数据库损坏,需要修复

问题解决过程:

备份数据库文件(很必要)

设置my.ini 中的innodb_force_recovery =1   

重启mysql,将原有数据导出,如果不行就修改上面的值,一点一点改大,直到导出不报错

卸载mysql,删除原数据库文件

重装mysql,创建新的数据库文件,导入原有数据   至此修复完成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值