1

I have modified the my.cnf for a MySQL 5 installation and now I receive the following error in syslog:

InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 268435456 bytes!
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

I have removed the lines from my.cnf one by one and found the error prone lines are:

innodb_log_file_size = 256M
innodb_log_files_in_group = 3

I don't see how specifying 256M limit is stopping a 5M file working.

Does anyone know what causes this problem?

RolandoMySQLDBA
  • 3,065
  • 1
  • 20
  • 25
James
  • 153
  • 4

2 Answers2

2

You need to do the following:

Add these lines to /etc/my.cnf (depending on your installation /etc/mysql/my.cnf)

[mysqld]
innodb_log_file_size = 256M
innodb_log_files_in_group = 2
innodb_buffer_pool_size=1G

then, do this:

service mysql stop
service mysql start --innodb-fast-shutdown=0
service mysql stop
rm -f /var/log/mysql/ib_logfile
service mysql start
Christoph
  • 103
  • 3
RolandoMySQLDBA
  • 3,065
  • 1
  • 20
  • 25
1

You're getting the error because you need to follow the proper documented method of Resizing a log file.

John T
  • 163,373
  • 27
  • 341
  • 348