启动时遇到以下报错:
[ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace xxx/xxxx uses space ID: 4 at filepath: ./xxx/xxxx.ibd. Cannot open tablespace mysql/gtid_slave_pos which uses space ID: 4 at filepath: ./mysql/gtid_slave_pos.ibd
后面还有一段说明:

InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Error: could not open single-table tablespace file ./mysql/gtid_slave_pos.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.

大概意思就是mysql/gtid_slave_pos这个表损坏了,无法应用redo日志来进行实例恢复。
那么只能设置innodb_force_recovery=1来跳过实例启动时检查表损坏情况。
启动时就有以下提示:
[Note] InnoDB: innodb_force_recovery was set to 1. Continuing crash recovery even though we cannot access the .ibd file of this table.
实例可以正常启动,但是mysql.gtid_slave_pos并没有修复。后续需要将数据逻辑导出迁移到一个正常的实例上。

顺便学习一下innodb_force_recovery,顾名思义就是强制innodb的实例恢复,可以取值1-6:
1(SRV_FORCE_IGNORE_CORRUPT):实例恢复时忽略检测到的页损坏、表损坏等;
2(SRV_FORCE_NO_BACKGROUND):实例恢复时不运行master thread和purge thread;
3(SRV_FORCE_NO_TRX_UNDO):实例恢复后不运行undo回滚;
4(SRV_FORCE_NO_IBUF_MERGE):实例恢复时不进行insert buffer的合并操作,这个级别会对数据文件造成永久的损坏,启动后应该重建所有二级索引。
5(SRV_FORCE_NO_UNDO_LOG_SCAN):实例恢复时对于未完成的事务不进行回滚。
6(SRV_FORCE_NO_LOG_REDO):实例恢复时不应用redo

[ERROR] InnoDB: Attempted to open a previously opened tablespace相关推荐

  1. lnnoDB:Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_index_stat

    今天启动服务后不小心把电脑强制重启了,导致navicate连接数据库时提示2003,接着使用命令net start mysql启动,但是提示服务无法启动 首先使用命令netstat -nao查看80端 ...

  2. mysql报错Attempted to open a previously opened tablespace的解决办法

    我的个人博客:逐步前行STEP 1.在配置文件添加: innodb_force_recovery = 1; 2.重启mysql服务:service mysqld restart 3.登陆mysql,导 ...

  3. MYSQL [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11

    1:重启 [root@iZuf63x5aylgn2n11k2sllZ etc]# systemctl restart mysql Job for mysql.service failed becaus ...

  4. [ERROR] InnoDB: ibdata1 different size (rounded down to MB)

    启动mysql实例报错,查看 error log ## 错误信息 2018-08-31T10:38:36.945081Z 0 [ERROR] InnoDB: The Auto-extending in ...

  5. [ERROR] InnoDB: Cannot open datafile for read-only: './dxh_sys/vendorUser.ibd' OS error: 71

    问题描述: 一次mysql从库重启后发现errorlog中报错信息:[ERROR] InnoDB: Cannot open datafile for read-only: './dxh_sys/ven ...

  6. mariadb启动报错:[ERROR] InnoDB: The Auto-extending innodb_system data file。。。

    报错内容:[ERROR] InnoDB: The Auto-extending innodb_system data file '/data/mysql-33061/data/ibdata1' is ...

  7. mysql persistent_MySQL关于InnoDB的几个错误

    阿里云服务器上装有MySQL 5.6,这几天MySQL服务经常死掉,启动MySQL服务(service mysql start),却报如下错误 Starting MySQL.. ERROR! The ...

  8. mysql日常错误信息解决方法:InnoDB: and force InnoDB to continue crash recovery here.

    今天早上上班来打开环境,mysql报了这个错误,猜到的原因应该是昨天晚上下班没等mysql服务器退出就关闭计算机. 2014-05-09 09:44:25 4128 [ERROR] InnoDB: A ...

  9. 机房断电、MySQL启动失败,InnoDB数据损坏如何恢复

    概要 [问题原因]服务器突然断电 [故障报告]数据库表结构损坏 [解决思路]进入强制恢复模式,库表及数据重建 故障发现 周末园区断电,周一启动数据库就直接报错了: ERROR! The server ...

  10. mysql数据库未启动失败_mysql数据库启动失败

    [email protected] dmp]# /etc/init.d/mysqld start Starting MySQL. ERROR! The server quit without upda ...

最新文章

  1. python成长之路11
  2. 遍历目录下的文件每250M打包一个文件
  3. csv.writer写入文件有多余的空行
  4. mui案例:导航栏 颜色渐变
  5. Linux 下几款程序内存泄漏检查工具
  6. Script:脚本获得用户User DDL包括system、object grant
  7. Java中堆内存和栈内存的区别
  8. 1717: [Usaco2006 Dec]Milk Patterns 产奶的模式
  9. 香港手机号正则表达式
  10. java项目上线发布的流程
  11. Visual Paradigm 顾客旅程地图 (Customer Journey Map)
  12. 电脑网络看不到其它计算机,解决网络和共享中看不到其他计算机的问题
  13. 论坛数据库的几种建表----年度项目拙计有感(前半部分转)
  14. 计算机辅助电话访问优势,电话访问的优点缺点、优势不足、局限性
  15. c# excel插入图表
  16. android studio 插入SVG图片
  17. 把ipa包上传入AppStore
  18. 固定linux虚拟机ip地址,虚拟机下linux 系统网卡配置、固定IP地址
  19. 【渝粤教育】电大中专学习指南作业 题库
  20. 什么是端口?要如何修改端口?

热门文章

  1. 储备池计算(Reservoir Computing)综述
  2. firefox浏览器一分钟去广告--去广告插件安装教程(adblock plus)
  3. 现代前端技术解析:前端三层结构与应用
  4. 488. 祖玛游戏【我亦无他唯手熟尔】
  5. 为什么说汽车VIN码是汽车唯一的身份证
  6. 科室管理系统中,运用百度编辑器(ueditor1_4_3-utf8-jsp)出现的一系列问题!
  7. 评分卡模型监控(后端分析)
  8. iOS解决“The ‘Pods-XXX‘ target has transitive dependencies that include statically linked binaries”报错
  9. Kubernetes 之 集群二进制部署
  10. 【JAVASE】IO流基础