关于[InnoDB] Unsupported redo log format (0). The redo log was created before MySQL 5.7.9的解决办法

本文介绍在CentOS7系统中遇到的MySQL慢关机问题及解决步骤。通过查找并删除ib_logfile0和ib_logfile1文件,备份my.cnf配置,最后重新启动MySQL服务,成功解决了因未进行慢关机导致的数据目录残留问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

关闭slow shutdown,我在centos7 上输入代码

slow shutdown
  • 1

发现没作用,也无效
然后,使用cd 进入 /var/lib/mysql/文件夹,

cd /var/lib/mysql
  • 1

其实不用进入,我直接查找的ib_logfile0 和ib_logfile1

find / -name ib_logfile0
find / -name ib_logfile1
  • 1
  • 2

利用mkdir和cp命令进行备份,

mkdir backup
cp /var/lib/mysql/ib_logfile0 /backup
cp /var/lib/mysql/ib_logfile1 /backup
  •  

然后删除备份前的这两个文件,

rm /var/lib/mysql/ib_logfile0
rm /var/lib/mysql/ib_logfile0
  •  

重新运行

service mysqld start
service mysqld status -l
  •  

成功运行

之后备份了my.cnf配置,并删除

rm /etc/my.cnf
  •  

删除 /var/lib/mysql解决

[ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.

的提示
rm -rf /var/lib/mysql
重新运行

service mysqld start
service mysqld status -l
  •  

无警告和报错

google原文

If you have already installed MySQL and did not perform a slow shutdown using the

innodb_fast_shutdown

Flag, simply go to your MySQL directory

/var/lib/mysql/

And remove the log files (Do not do this if you need the table data in your database until you have backed up your database):

ib_logfile0 ib_logfile1

Back them up before if you need them again

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值