Sample Header Ad - 728x90

How to safely change MySQL innodb variable 'innodb_log_file_size'?

117 votes
5 answers
243119 views
So I'm fairly new to tuning InnoDB. I'm slowly changing tables (where necessary) from MyIsam to InnoDB. I've got about 100MB in innodb, so I increased the innodb_buffer_pool_size variable to 128MB: mysql> show variables like 'innodb_buffer%'; +-------------------------+-----------+ | Variable_name | Value | +-------------------------+-----------+ | innodb_buffer_pool_size | 134217728 | +-------------------------+-----------+ 1 row in set (0.00 sec) When I went to change the innodb_log_file_size value (example my.cnf on mysql's innodb configuration page comments to change the log file size to 25% of the buffer size. So now my my.cnf looks like this: # innodb innodb_buffer_pool_size = 128M innodb_log_file_size = 32M When I restart the server, I get this error: > 110216 9:48:41 InnoDB: Initializing buffer pool, size = 128.0M 110216 9:48:41 InnoDB: Completed initialization of buffer pool InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes InnoDB: than specified in the .cnf file 0 33554432 bytes! 110216 9:48:41 [ERROR] Plugin 'InnoDB' init function returned error. 110216 9:48:41 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. So my question: Is it safe to delete the old log_files, or is there another method to change the innodb_log_file_size variable?
Asked by Derek Downey (23568 rep)
Feb 16, 2011, 03:01 PM
Last activity: Feb 9, 2023, 12:33 AM