Solution “InnoDB Error ib_logfile0 is of different size”

Once increasing the size of “innodb_log_file_size”, I noticed an error in the /var/log/mysql/error.log file:

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.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting

As you can see from the error message, the size of the existing ib_logfile0 file is 5M, and the value for “innodb_log_file_size” is 256M, this is true, because I increased it in the mysql configuration file, which is why the error occurs. Although this is strange, since I often increased the “innodb_log_file_size” and the MySQL server, at startup, deleted the old ib_logfile files and created new ones, but in this case I had to delete them manually (it is necessary to stop the MySQL server):

/etc/init.d/mysql stop
rm /var/lib/mysql/ib_logfile*
/etc/init.d/mysql start

After that, the following information was displayed in the logs:

InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 256 MB
InnoDB: Database physically writes the file full: wait…
InnoDB: Progress in MB: 100 200
InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 256 MB
InnoDB: Database physically writes the file full: wait…
InnoDB: Progress in MB: 100 200

And the MySQL server started successfully.

The error can also be resolved if you specify the old value for “innodb_log_file_size” in the MySQL configuration file.

See also my article:
Changing InnoDB log file size in MySQL

Join the Conversation

1 Comment

Leave a Reply

Discover more from IT Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading