innodb文件损坏处理
innodb文件损坏报错如下:
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]
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.
2018-09-03T09:52:43.486544Z 0 [Note] InnoDB: Page dump in ascii and hex (16384 bytes):
len 16384; hex 0d00000003003600013700c6003600000000000000000000000000000000000000000000000000000000000000000000000000000000810a81bcff2606027b04811b4c8d4172697374657520526f7a616e736b69203c61726f7a616e736b407265646861742e636f6d3e205b322e362e33322d3134372e656c365d4dc928c02d205b6275696c645d2064697361626c65205765727220666f722065787465726e616c206d6f64756c657320284172697374657520526f7a616e736b6929205b3730333530345d880f81bcff2506027b048f254c8d4172697374657520526f7a616e736b69203c61726f7a616e736b407265646861742e636f6d3e205b322e362e33322d3134382e656c365d4dcbcbc02d205b6e65745d20646363703a2068616e646c6520696e76616c69642066656174757265001df982854381bcff2406027b048a0d4c8d4172697374657520526f7a616e736b69203c61726f7a616e736b407265646861742e636f6d3e205b322e362e33322d3134392e656c365d4dcd1d402d205b7838365d204d43453a2044726f70207468652064656661756c74206465636f64696e67206e6f746966696572202850726172697420426861726761766129205b3638383238315d0a2d205b7838365d204d43453a20446f206e6f74207461696e74207768656e2068616e646c696e6720636f727265637461626c65206572726f7273202850726172697420426861726761766129205b3638383238315d0a2d205b6b65726e656c5d207072696e746b3a2075736520704b20666f72202f70726f632f6b616c6c73796d7320616e64202f70726f632f6d6f64756c657320285068696c6c692018-09-03T09:52:43.492211Z 0 [Note] Semi-sync replication initialized for transactions.
2018-09-03T09:52:43.504398Z 0 [Note] Semi-sync replication enabled on the master.
70204c6f756768657229205b3637393236325d0a2d205b6b65726e656c5d2074696d65722064656275673a2048696465206b65726e656c206164647265737365732076696120704b20696e202f70726f632f74696d65725f6c69737420285068696c6c6970204c6f756768657229205b3637393236325d0a2d205b64726d5d20646f206e6f74206c65616b206b65726e656c2061646472657373657320766961202f70726f632f6472692f2a2f2018-09-03T09:52:43.504481Z 0 [Note] Starting ack receiver thread
766d6120285068696c6c6970204c6f756768657229205b3637393236325d0a2d205b6b65726e656c5d206b7074725f726573747269637420666f7220686964696e67206b65726e656c20706f696e746572732066726f6d20756e70726976696c6567656420757365727320285068696c6c6970204c6f756768657229205b3637393236325d0a2d205b6e65745d20666978206e65746e732076732070726f746f20726567697374726174696f6e206f2018-09-03T09:52:43.504874Z 0 [Note] Recovering after a crash using mysql-bin
2018-09-03T09:52:43.510443Z 0 [Note] Starting crash recovery...
72646572696e67202857616465204d65616c696e6729205b3730323330365d207b4356452d323031312d31373637204356452d323031312d313736387d00000000206f7074696f6e73206c656e67746820284a697269205069726b6f29205b3730333031335d207b4356452d2018-09-03T09:52:43.510528Z 0 [Note] Crash recovery finished.
使用innodb_force_recovery参数来恢复,innodb_force_recovery参数有6个选项具体如下
1 (SRV_FORCE_IGNORE_CORRUPT) 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. 2 (SRV_FORCE_NO_BACKGROUND) Prevents the master thread and any purge threads from running. If a crash would occur during the purge operation, this recovery value prevents it. 3 (SRV_FORCE_NO_TRX_UNDO) Does not run transaction rollbacks after crash recovery. 4 (SRV_FORCE_NO_IBUF_MERGE) Prevents insert buffer merge operations. If they would cause a crash, does not do them. Does not calculate table statistics.
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. 5 (SRV_FORCE_NO_UNDO_LOG_SCAN) Does not look at undo logs when starting the database: InnoDB treats even incomplete transactions as committed.
This value can permanently corrupt data files. Sets InnoDB to read-only. 6 (SRV_FORCE_NO_LOG_REDO) Does not do the redo log roll-forward in connection with recovery. This value can permanently corrupt data files.
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.
尽量用最小的参数尝试启动,大的包含小的
innodb_force_recovery=1
修改参数以后启动成功,mysqlcheck工具检查看具体哪个表的文件损坏。
[root@redis03 data]# mysqlcheck -A -u root -p
Enter password:
ht.tb OK
mysql.columns_priv OK
mysql.db OK
mysql.engine_cost OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.gtid_executed OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.server_cost OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
sys.sys_config OK
如果有损坏可以先备份出来删除原表在导入进去
mysqldump --databases ht --set-gtid-purged=OFF >ht.sql
mysql -u root -p < ht.sql
innodb文件损坏处理的更多相关文章
- mysql启动后随即关闭问题解决(ibdata1文件损坏导致)
机房一台服务器上的mysql运行一段时间了,突然出现了一个很奇怪的现象:重启后无法恢复了!准确情况是:启动mysql后随即就又关闭了. 查看mysql错误日志如下: 160920 22:41:41 m ...
- MySQL实例多库某张表数据文件损坏导致xxx库无法访问故障恢复
一.问题发现 命令行进入数据库实例手动给某张表进行alter操作,发现如下报错. mysql> use xx_xxx; No connection. Trying to reconnect... ...
- MySQL数据库INNODB 表损坏修复处理过程
MySQL数据库INNODB 表损坏修复处理过程 博客分类: mysql tomcatmysql 最近mysql数据库经常死掉,用命令net stop mysql命令也无法停掉,关闭Tomcat的时 ...
- 记录SQL Server2008日志文件损坏的恢复过程
记录SQL Server2008日志文件损坏的恢复过程: 环境: 系 统:Windows Server2003 数据库:SQL Server2008 故障原因: 通过mstsc链接同一服务器时,用户界 ...
- 由于OCR文件损坏造成Oracle RAC不能启动的现象和处理方法
v$cluster_interconnects 集群节点间通信使用的IP地址 错误信息 使用了公网进行连接 SQL> select * from v$cluster_interconnects; ...
- haoop 断电后导致block文件损坏
hbase将dfs作为存储,公司测试环境断电后,hadoop集群会因此而损坏一些block文件,这个时候,客户端在读取文件时会报一些错: DataXceiver error processing RE ...
- 遭遇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 ...
- 【O】VSS 2005上传PDF文件之后,打开提示文件损坏或者内容为空
问题: VSS 2005上传PDF文件之后,打开提示文件损坏或者内容为空: 解决方式: 在vss的客户端的tools-option中,file type选项卡里,在binary file文本框中,加入 ...
- mongodb文件损坏的恢复--无可恢复数据
1.mongodb 启动异常error code 100,检查日志,数据文件损坏 2 检查collection-15-6548623434943640018.wt 可恢复数据,为空,不存在恢复的数据 ...
随机推荐
- HTML文字与列表
文字内容 添加文字 <body> 我是Mingle </body> HTML文字的需要添加在<body> </body>里面. 标题字 标题字就是以几种 ...
- sql 日常使用记录
sql 某个字段在哪些表中存在: select sysobjects.name from syscolumns inner join sysobjects on syscolumns.id = sys ...
- php中一些容易混淆的函数总结
在我们日常PHP开发中,经常会使用一些函数完成相关操作,但是有些函数功能相近,很容易混淆,再次总结一下 1. __DIR__ && getcwd() 看官方解释: getcwd: ...
- Vue中Vuex的详解与使用(简洁易懂的入门小实例)
怎么安装 Vuex 我就不介绍了,官网上有 就是 npm install xxx 之类的.(其实就是懒~~~哈哈) 那么现在就开始正文部分了 众所周知 Vuex 是什么呢?是用来干嘛的呢? Vuex ...
- Shell命令-文件及内容处理之split、paste
文件及内容处理 - split.paste 1. split:分割文件为不同的小片段 split命令的功能说明 split 命令用于将一个文件分割成数个.该指令将大文件分割成较小的文件,在默认情况下将 ...
- python之路7-正则表达式
正则表达式用于做字符串匹配,在python中用re模块来操作 生成正则的在线工具:http://tool.chinaz.com/regex
- https://oi-wiki.org/
OI网站 https://oi-wiki.org/
- Redux Counter Vanilla example
此示例不需要构建系统或视图框架,并且存在以显示与ES5一起使用的原始Redux API. 代码如下 <!DOCTYPE html> <html> <head> &l ...
- JAVA WEB开发环境与搭建
一:jdk下载与安装 (1)官网下载地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-506665 ...
- Luogu P1654 OSU!
写法和CF235B Let's Play Osu!非常相似.但是这个题厉害就厉害在统计的贡献里面有一个平方的期望,而这个平方的期望和期望的平方是完全不一样的,需要另外统计,逻辑上仔细想一想就会明白. ...