MySQL 无法启动,出现 “发生系统错误 1067。”

出现场景

使用 net start mysql 时无法启动,并出现:发生系统错误 1067。

解决过程

很多情况都可以导致该错误提示,可以先查找 “Windows 日志” :

打开【Windows 帮助和支持】,查找【log】,打开【事件查看器】,【Windows 日志】下,【应用程序】中,找到 MySQL 相关的错误信息。

我的错误信息是:
InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_table_stats uses space ID: 1 at filepath: .mysqlinnodb_table_stats.ibd. Cannot open tablespace student_db/student which uses space ID: 1 at filepath: .student_dbstudent.ibd

于是变成了解决以上错误信息,其解决方式:

  1. 在 my.ini 中添加 innodb_force_recovery = 1 ,这时可以成功启动了,但并没有实际解决问题。
  2. 导出 student_db 数据库(导致问题的数据库),关闭 MySQL。
  3. 删除 ibdata1、ib_logfile0、ib_logfile1 文件和 student_db 目录。
  4. 注释掉 1 中的设置,启动 MySQL,重新导入 student_db。
原文地址:https://www.cnblogs.com/blueherb/p/10531895.html