yzc164 发表于 2018-10-9 09:55:41

mysql迁移报错

  将mysql目录直接拷贝迁移,过程不详述,数据库正常启动,但是不能正常使用,select查表报表不存在,然后发现日志报错如下
  InnoDB: Doing recovery: scanned up to log sequence number 265335480935
  170504 15:56:39InnoDB: Error: page 311313 log sequence number 265338125392
  InnoDB: is in the future! Current system log sequence number 265335480935.
  InnoDB: Your database may be corrupt or you may have copied the InnoDB
  InnoDB: tablespace but not the InnoDB log files
  解决办法:
  在/etc/my.cnf文件的下添加
  innodb_force_recovery = 4
  重启mysqld恢复正常,问题解决,记得之后将“innodb_force_recovery = 4”删掉再重启一次,否则还会出现问题
  关于innodb_force_recovery的一些说明
  innodb_force_recovery可以设置为1-6,大的数字包含前面所有数字的影响。
  1. (SRV_FORCE_IGNORE_CORRUPT):忽略检查到的corrupt页。
  2. (SRV_FORCE_NO_BACKGROUND):阻止主线程的运行,如主线程需要执行full purge操作,会导致crash。
  3. (SRV_FORCE_NO_TRX_UNDO):不执行事务回滚操作。
  4. (SRV_FORCE_NO_IBUF_MERGE):不执行插入缓冲的合并操作。
  5. (SRV_FORCE_NO_UNDO_LOG_SCAN):不查看重做日志,InnoDB存储引擎会将未提交的事务视为已提交。
  6. (SRV_FORCE_NO_LOG_REDO):不执行前滚的操作。

页: [1]
查看完整版本: mysql迁移报错