MySQL - InnoDB: Error: log file ./ib logfile0 is of different size или как правильно увеличить параметр innodb log file size

Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2023
Перейти к:навигация, поиск
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


MySQL - InnoDB: Error: log file ./ib logfile0 is of different size или как правильно увеличить параметр innodb log file size

Если мы просто в конфиге my.cnf поменяли размер innodb_log_file_size и перезапустили mysql/mariadb сервер - то получим ошибку как ниже:

InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 536870912 bytes!
InnoDB: Possible causes for this error:
(a) Incorrect log file is used or log file size is changed
(b) In case default size is used this log file is from 10.0
(c) Log file is corrupted or there was not enough disk space
In case (b) you need to set innodb_log_file_size = 48M
170912 15:30:09 [ERROR] Plugin 'InnoDB' init function returned error.
170912 15:30:09 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170912 15:30:09 [Note] Plugin 'FEEDBACK' is disabled.
170912 15:30:09 [ERROR] Unknown/unsupported storage engine: InnoDB
170912 15:30:09 [ERROR] Aborting

Как правильно нужно менять размер параметра innodb_log_file_size - ниже написаны шаги (пример для CentOS 7 + MariaDB):

1) Остановить mysqld/mariadb сервер:
 # systemctl stop mariadb
2) Удалить бинлоги - их всегда 2 файла - ib_logfile1 и ib_logfile0:
# rm -rf /var/lib/mysql/ib_logfile*
3) Изменяем зачение innodb_log_file_size на нужное нам:
# vi /etc/my.cnf
 innodb_log_file_size=512M
4) Запускам mysqld/mariadb сервер и проверяем размер 2х бинлогов, из должен был создать mysql сервер:
# systemctl start mariadb
# du -sh /var/lib/mysql/ib_logfile*
513M    /var/lib/mysql/ib_logfile0
513M    /var/lib/mysql/ib_logfile1