问题介绍:从一个备份恢复到一个新的实例上面,启动mysql的 时候报如下错
2018-02-28T02:38:00.618787Z 0 [ERROR] InnoDB: ./ib_logfile0 can't be opened in read-write mode.
2018-02-28T02:38:00.618805Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-02-28T02:38:01.219287Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-02-28T02:38:01.219316Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-02-28T02:38:01.219323Z 0 [ERROR] Failed to initialize plugins.
2018-02-28T02:38:01.219332Z 0 [ERROR] Aborting
2018-02-28T02:38:01.219340Z 0 [Note] Binlog end
2018-02-28T02:38:01.219885Z 0 [Note] mysqld: Shutdown complete
原因:因为是之前使用过的数据库,现在需要重新部署,就要清空log文件。
解决方法:
1、关闭mysql数据库
2、进入mysql的data目录,删除以下3个文件:ib_logfile0和 ib_logfile1 ib_logfile2
[root@localhost data]# mv ib_logfile0 ib_logfile0.bak
[root@localhost data]# mv ib_logfile1 ib_logfile1.bak
[root@localhost data]# mv ib_logfile2 ib_logfile2.bak
2018-02-28T02:38:00.618787Z 0 [ERROR] InnoDB: ./ib_logfile0 can't be opened in read-write mode.
2018-02-28T02:38:00.618805Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-02-28T02:38:01.219287Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-02-28T02:38:01.219316Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-02-28T02:38:01.219323Z 0 [ERROR] Failed to initialize plugins.
2018-02-28T02:38:01.219332Z 0 [ERROR] Aborting
2018-02-28T02:38:01.219340Z 0 [Note] Binlog end
2018-02-28T02:38:01.219885Z 0 [Note] mysqld: Shutdown complete
原因:因为是之前使用过的数据库,现在需要重新部署,就要清空log文件。
解决方法:
1、关闭mysql数据库
2、进入mysql的data目录,删除以下3个文件:ib_logfile0和 ib_logfile1 ib_logfile2
[root@localhost data]# mv ib_logfile0 ib_logfile0.bak
[root@localhost data]# mv ib_logfile1 ib_logfile1.bak
[root@localhost data]# mv ib_logfile2 ib_logfile2.bak
3、重新启动mysql
本文介绍了在MySQL数据库恢复过程中遇到InnoDB日志文件无法以读写模式打开的问题及解决方案。通过关闭数据库服务、移除特定日志文件并重启服务的方法成功解决了该问题。
783

被折叠的 条评论
为什么被折叠?



