当前位置:Gxlcms > 数据库问题 > mysql 使用 Forcing InnoDB Recovery 恢复数据库

mysql 使用 Forcing InnoDB Recovery 恢复数据库

时间:2021-07-01 10:21:17 帮助过:19人阅读

启动库并备份数据,重新建库。


关于innodb_force_recovery 参数值的描述如下:

As a safety measure, InnoDB prevents INSERTUPDATE, or DELETE operations when innodb_force_recovery is greater than 0.

  • 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 purgeoperation, 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 tablestatistics. This value can permanently corrupt data files. After using this value, be prepared to drop and recreate all secondary indexes.

  • 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.

  • 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.

在my.cnf文件配置参数 

innodb_force_recovery = 6

innodb_purge_thread=0

注意: innodb_purge_thread 参数的设置为0 ,以免在配置别的值后,数据库启动会一直报错 InnoDB: Waiting for the background threads to start。



[root@Illinois ~]# service mysql start

Starting MySQL (Percona Server)..[确定]

启动成功,接下来dump 数据,接着重建库就OK了!






本文出自 “虫子” 博客,请务必保留此出处http://worms.blog.51cto.com/969144/1676738

mysql 使用 Forcing InnoDB Recovery 恢复数据库

标签:mysql 使用 forcing innodb recovery 恢复数据库

人气教程排行