Jquery中文网 www.jquerycn.cn
Jquery中文网 >  数据库  >  mysql  >  正文 Mysql启动中InnoDB: Error: log file ./ib_logfile0 is of different size 0错误的解决办法

Mysql启动中InnoDB: Error: log file ./ib_logfile0 is of different size 0错误的解决办法

发布时间:2014-08-14   编辑:www.jquerycn.cn
Mysql启动中InnoDB: Error: log file ./ib_logfile0 is of different size 0错误的解决办法

使用默认my.cnf(一般教程都会教你使用support-files/my-medium.cnf)的Mysql服务,如果使用innodb表,innodb默认的log file大小是56M。
如果你的配置文件使用了类似my-innodb-heavy-4G.cnf作为配置文件时,Mysql可以正常启动,但innodb的表无法使用。

错误日志:
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes

解决办法:
把原来的innodb的ib_logfile*备份到一个目录下,然后删除掉原来的文件,重启 mysql。
# cp ib_logfile* /home/others
# rm -rf ib_logfile*
# service mysqld restart

你会看到ib_logfile*大小变成了你配置文件中指定的大小。
my-innodb-heavy-4G.cnf的话(log file 的大小是256M:innodb_log_file_size = 256M)
你会看到很多个268435456大小的文件,用ls -lh命令查看,结果如下:
img1

您可能感兴趣的文章:
Mysql启动中InnoDB: Error: log file ./ib_logfile0 is of different size 0错误的解决办法
mysql禁用日志后无法启动问题怎么解
Mysql5.5 InnoDB存储引擎的配置与优化
centos下mysql 5.6.13源码安装方法
mysql无法启动怎么办?mysql-bin权限问题导致mysql无法启动
mysql-bin权限问题导致mysql无法启动怎么办
mysql启动故障一例
mysql主从配置的三个错误及解决方法(图文)
[ERROR] Can't start server: can't create PID file: 问题的解决方法
mysql 误删除ibdata1的恢复方法

[关闭]