0
点赞
收藏
分享

微信扫一扫

InnoDB: ./ib_logfile0 can't be opened in read-write mode.


问题介绍:从一个备份恢复到一个新的实例上面,启动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

3、重新启动mysql


举报

相关推荐

0 条评论