如上述操作无效,请尝试如下操作
1. Open my.ini
2. In [mysqld] section, add the following line:
innodb_force_recovery = 1
3. Save the file and try starting MySQL
4. Remove that line which you just added and Save.
原因:查看data目录下的主机名.err日志,可以看到如下信息,日志中说明的解决方法3即为简单粗暴行之有效的方式
- 2015-10-13 10:24:32 8200 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace byt_atuxe/at_post uses space ID: 22 at filepath: .\byt_atuxe\at_post.ibd. Cannot open tablespace byt_iot/tbl_migration which uses space ID: 22 at filepath: .\byt_iot\tbl_migration.ibd
- InnoDB: Error: could not open single-table tablespace file .\byt_iot\tbl_migration.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.
复制代码
|