innodb文件损坏报错如下:

  1. 2018-09-03T09:52:43.486363Z 0 [ERROR] InnoDB: Space id and page no stored in the page, read in are [page id: space=0, page number=50345472], should be [page id: space=0, page number=408]
  2. 2018-09-03T09:52:43.486498Z 0 [ERROR] InnoDB: Database page corruption on disk or a failed file read of page [page id: space=0, page number=408]. You may have to recover from a backup.
  3. 2018-09-03T09:52:43.486544Z 0 [Note] InnoDB: Page dump in ascii and hex (16384 bytes):
  4. len 16384; hex 0d00000003003600013700c6003600000000000000000000000000000000000000000000000000000000000000000000000000000000810a81bcff2606027b04811b4c8d4172697374657520526f7a616e736b69203c61726f7a616e736b407265646861742e636f6d3e205b322e362e33322d3134372e656c365d4dc928c02d205b6275696c645d2064697361626c65205765727220666f722065787465726e616c206d6f64756c657320284172697374657520526f7a616e736b6929205b3730333530345d880f81bcff2506027b048f254c8d4172697374657520526f7a616e736b69203c61726f7a616e736b407265646861742e636f6d3e205b322e362e33322d3134382e656c365d4dcbcbc02d205b6e65745d20646363703a2068616e646c6520696e76616c69642066656174757265001df982854381bcff2406027b048a0d4c8d4172697374657520526f7a616e736b69203c61726f7a616e736b407265646861742e636f6d3e205b322e362e33322d3134392e656c365d4dcd1d402d205b7838365d204d43453a2044726f70207468652064656661756c74206465636f64696e67206e6f746966696572202850726172697420426861726761766129205b3638383238315d0a2d205b7838365d204d43453a20446f206e6f74207461696e74207768656e2068616e646c696e6720636f727265637461626c65206572726f7273202850726172697420426861726761766129205b3638383238315d0a2d205b6b65726e656c5d207072696e746b3a2075736520704b20666f72202f70726f632f6b616c6c73796d7320616e64202f70726f632f6d6f64756c657320285068696c6c692018-09-03T09:52:43.492211Z 0 [Note] Semi-sync replication initialized for transactions.
  5. 2018-09-03T09:52:43.504398Z 0 [Note] Semi-sync replication enabled on the master.
  6. 70204c6f756768657229205b3637393236325d0a2d205b6b65726e656c5d2074696d65722064656275673a2048696465206b65726e656c206164647265737365732076696120704b20696e202f70726f632f74696d65725f6c69737420285068696c6c6970204c6f756768657229205b3637393236325d0a2d205b64726d5d20646f206e6f74206c65616b206b65726e656c2061646472657373657320766961202f70726f632f6472692f2a2f2018-09-03T09:52:43.504481Z 0 [Note] Starting ack receiver thread
  7. 766d6120285068696c6c6970204c6f756768657229205b3637393236325d0a2d205b6b65726e656c5d206b7074725f726573747269637420666f7220686964696e67206b65726e656c20706f696e746572732066726f6d20756e70726976696c6567656420757365727320285068696c6c6970204c6f756768657229205b3637393236325d0a2d205b6e65745d20666978206e65746e732076732070726f746f20726567697374726174696f6e206f2018-09-03T09:52:43.504874Z 0 [Note] Recovering after a crash using mysql-bin
  8. 2018-09-03T09:52:43.510443Z 0 [Note] Starting crash recovery...
  9. 72646572696e67202857616465204d65616c696e6729205b3730323330365d207b4356452d323031312d31373637204356452d323031312d313736387d00000000206f7074696f6e73206c656e67746820284a697269205069726b6f29205b3730333031335d207b4356452d2018-09-03T09:52:43.510528Z 0 [Note] Crash recovery finished.

  使用innodb_force_recovery参数来恢复,innodb_force_recovery参数有6个选项具体如下

  1. 1 (SRV_FORCE_IGNORE_CORRUPT)
  2.  
  3. Lets the server run even if it detects a corrupt page. Tries to make SELECT * FROM tbl_name jump over corrupt index records and pages, which helps in dumping tables.
  4.  
  5. 2 (SRV_FORCE_NO_BACKGROUND)
  6.  
  7. Prevents the master thread and any purge threads from running. If a crash would occur during the purge operation, this recovery value prevents it.
  8.  
  9. 3 (SRV_FORCE_NO_TRX_UNDO)
  10.  
  11. Does not run transaction rollbacks after crash recovery.
  12.  
  13. 4 (SRV_FORCE_NO_IBUF_MERGE)
  14.  
  15. Prevents insert buffer merge operations. If they would cause a crash, does not do them. Does not calculate table statistics.
  16. This value can permanently corrupt data files. After using this value, be prepared to drop and recreate all secondary indexes. Sets InnoDB to read-only.
  17.  
  18. 5 (SRV_FORCE_NO_UNDO_LOG_SCAN)
  19.  
  20. Does not look at undo logs when starting the database: InnoDB treats even incomplete transactions as committed.
  21. This value can permanently corrupt data files. Sets InnoDB to read-only.
  22.  
  23. 6 (SRV_FORCE_NO_LOG_REDO)
  24.  
  25. Does not do the redo log roll-forward in connection with recovery. This value can permanently corrupt data files.
  26. Leaves database pages in an obsolete state, which in turn may introduce more corruption into B-trees and other database structures. Sets InnoDB to read-only.

  尽量用最小的参数尝试启动,大的包含小的

  1. innodb_force_recovery=1

  修改参数以后启动成功,mysqlcheck工具检查看具体哪个表的文件损坏。

  1. [root@redis03 data]# mysqlcheck -A -u root -p
  2. Enter password:
  3. ht.tb OK
  4. mysql.columns_priv OK
  5. mysql.db OK
  6. mysql.engine_cost OK
  7. mysql.event OK
  8. mysql.func OK
  9. mysql.general_log OK
  10. mysql.gtid_executed OK
  11. mysql.help_category OK
  12. mysql.help_keyword OK
  13. mysql.help_relation OK
  14. mysql.help_topic OK
  15. mysql.innodb_index_stats OK
  16. mysql.innodb_table_stats OK
  17. mysql.ndb_binlog_index OK
  18. mysql.plugin OK
  19. mysql.proc OK
  20. mysql.procs_priv OK
  21. mysql.proxies_priv OK
  22. mysql.server_cost OK
  23. mysql.servers OK
  24. mysql.slave_master_info OK
  25. mysql.slave_relay_log_info OK
  26. mysql.slave_worker_info OK
  27. mysql.slow_log OK
  28. mysql.tables_priv OK
  29. mysql.time_zone OK
  30. mysql.time_zone_leap_second OK
  31. mysql.time_zone_name OK
  32. mysql.time_zone_transition OK
  33. mysql.time_zone_transition_type OK
  34. mysql.user OK
  35. sys.sys_config OK

  如果有损坏可以先备份出来删除原表在导入进去

  1. mysqldump --databases ht --set-gtid-purged=OFF >ht.sql
  2. mysql -u root -p < ht.sql

  

innodb文件损坏处理的更多相关文章

  1. mysql启动后随即关闭问题解决(ibdata1文件损坏导致)

    机房一台服务器上的mysql运行一段时间了,突然出现了一个很奇怪的现象:重启后无法恢复了!准确情况是:启动mysql后随即就又关闭了. 查看mysql错误日志如下: 160920 22:41:41 m ...

  2. MySQL实例多库某张表数据文件损坏导致xxx库无法访问故障恢复

    一.问题发现 命令行进入数据库实例手动给某张表进行alter操作,发现如下报错. mysql> use xx_xxx; No connection. Trying to reconnect... ...

  3. MySQL数据库INNODB 表损坏修复处理过程

    MySQL数据库INNODB 表损坏修复处理过程 博客分类: mysql tomcatmysql  最近mysql数据库经常死掉,用命令net stop mysql命令也无法停掉,关闭Tomcat的时 ...

  4. 记录SQL Server2008日志文件损坏的恢复过程

    记录SQL Server2008日志文件损坏的恢复过程: 环境: 系 统:Windows Server2003 数据库:SQL Server2008 故障原因: 通过mstsc链接同一服务器时,用户界 ...

  5. 由于OCR文件损坏造成Oracle RAC不能启动的现象和处理方法

    v$cluster_interconnects 集群节点间通信使用的IP地址 错误信息 使用了公网进行连接 SQL> select * from v$cluster_interconnects; ...

  6. haoop 断电后导致block文件损坏

    hbase将dfs作为存储,公司测试环境断电后,hadoop集群会因此而损坏一些block文件,这个时候,客户端在读取文件时会报一些错: DataXceiver error processing RE ...

  7. 遭遇ORA-01078,LRM-00109,ORA-27046 SPFILE文件损坏

    今天在启动数据库时遭遇到 $ sqlplus / as sysdba SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jul 16 21:28:03 ...

  8. 【O】VSS 2005上传PDF文件之后,打开提示文件损坏或者内容为空

    问题: VSS 2005上传PDF文件之后,打开提示文件损坏或者内容为空: 解决方式: 在vss的客户端的tools-option中,file type选项卡里,在binary file文本框中,加入 ...

  9. mongodb文件损坏的恢复--无可恢复数据

    1.mongodb 启动异常error code 100,检查日志,数据文件损坏 2 检查collection-15-6548623434943640018.wt 可恢复数据,为空,不存在恢复的数据 ...

随机推荐

  1. cmdb部署

    参考资料:https://github.com/guohongze/adminset 基础安装说明:1.基本要求:centos 7.2(1511) django 1.9.8(兼容Django1.11) ...

  2. Java 208 道面试题:第一模块答案

    目前市面上的面试题存在两大问题:第一,题目太旧好久没有更新了,还都停留在 2010 年之前的状态:第二,近几年 JDK 更新和发布都很快,Java 的用法也变了不少,加上 Java 技术栈也加入了很多 ...

  3. 在 CentOS 7 中安装 MySQL 8

    准备 本文环境信息: 软件 版本 CentOS CentOS 7.4 MySQL 8.0.x 安装前先更新系统所有包 sudo yum update 安装 1. 添加 Yum 包 wget https ...

  4. python部署lvs

    lvs-dr-rr import paramiko vip = '192.168.254.250' ds = '192.168.254.17' rs1 = '192.168.254.37' rs2 = ...

  5. docker(四) 使用Dockerfile构建镜像

    下面以一个例子来演示构建镜像的过程. #在/tmp目录下演示 cd tmp mkdir build-redis-image 1.创建Dockerfile文件 vim Dockerfile 并写入如下内 ...

  6. tomcat知识(一)

    1.tomcat配置javaWeb项目常见错误: ①:端口占用 ②:未配置JAVA_HOME环境变量 2.tomcat修改端口号 tomcat安装路径下面找到conf文件夹,修改server.xml文 ...

  7. mysql 基本语句

    求知若渴 虚心若愚   博客园 首页 新随笔 联系 管理 随笔-391  文章-0  评论-7  mysql sql常用语句大全   SQL执行一次INSERT INTO查询,插入多行记录 inser ...

  8. Hdoj 1850.Being a Good Boy in Spring Festival 题解

    Problem Description 一年在外 父母时刻牵挂 春节回家 你能做几天好孩子吗 寒假里尝试做做下面的事情吧 陪妈妈逛一次菜场 悄悄给爸爸买个小礼物 主动地 强烈地 要求洗一次碗 某一天早 ...

  9. Mybatis Generator的model生成中文注释,支持oracle和mysql(通过实现CommentGenerator接口的方法来实现)

    自己手动实现的前提,对maven项目有基本的了解,在本地成功搭建了maven环境,可以参考我之前的文章:maven环境搭建 项目里新建表时model,mapper以及mapper.xml基本都是用My ...

  10. [CTSC2018]暴力写挂

    题目描述 www.lydsy.com/JudgeOnline/upload/201805/day1(1).pdf 题解 首先来看这个我们要最大化的东西. deep[u]+deep[v]-deep[lc ...