HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Mariadb - Variable 'innodb_log_file_size' is a read only variable

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
readinnodb_log_file_sizevariableonlymariadb

Problem

Im using mariadb 10.0.29, I need to change the innodb file size to 256M, default size 50M,

My config file is located on

/etc/mysql/mariadb.conf.d/50-server.cnf


I have added the below line, but it won't work.

[mysqld]
innodb_log_file_size=256M


Also I tried set innodb_log_file_size=5033164800;

But it shows

ERROR 1238 (HY000): Variable 'innodb_log_file_size' is a read only variable

Solution

You might have to consider two things before doing this.

-
Ensure innodb_fast_shutdown SHOULDN'T BE 2. If it is? change it
to 1 globally.

-
Verify step 1, query: show variables like 'innodb_fast_shutdown';

-
Shutdown Mysql.

-
Ensure you copy the iblogfile0&1 into a safer place and then
remove from data dir.

-
Make changes to my.cnf for innodb_log_file_size as per your
desired option.

-
Start Mysql

Rollback: If it doesn't start for some reason put back the iblogfiles and start.

Please see link https://dev.mysql.com/doc/refman/5.5/en/innodb-data-log-reconfiguration.html for detailed explanation


UPDATE: In our chat we narrowed down that my.cnf was pointed to a
different file or picked default ones. We forced mysql to pick the
mentioned my.cnf via mysqld_safe --defaults-file. And it worked.

Context

StackExchange Database Administrators Q#173789, answer score: 6

Revisions (0)

No revisions yet.