mysql wont start after increasing innodb_buffer_pool_size and innodb_log_file_size

The two answers given from @RickJames and @drogart are essentially the remedies. (+1 for each).

Right from the error log you present, the last two lines say:

InnoDB: Error: log file ./ib_logfile0 is of different size 0 134217728 bytes

InnoDB: than specified in the .cnf file 0 268435456 bytes! `

At that point, it was evident that you set innodb_log_file_size to 256M (268435456) in my.cnf while the InnoDB Transaction Logs (ib_logfile0,ib_logfile1) were respectively 128M (134217728) each. Looking back at the link to my StackOverflow answer in your question, you had to do the following:

Step 01) Add this to my.cnf:


Step 02) Run these command in the OS

mysql -u... -p... -e"SET GLOBAL innodb_fast_shutdown = 1"
service mysql stop
rm -f /var/lib/mysql/ib_logfile*
service mysql start

So as to have confidence in what is happening, run tail -f against the error log. You will see message telling you when each innodb log file is being created.

Based on the error in the log, I'm guessing you did this:

  • shut down mysql
  • edited my.cnf to change the innodb log file size
  • tried to start mysql (then it failed)

If you change the log file size, you need to remove the old log files. Innodb will not start successfully if the existing files do not match the specified size in the config file. If you move them elsewhere, innodb will create new transaction log files of the correct size when it starts.

I would recommend moving the old files to another directory instead of just deleting them, until the server is up and running with new log files and everything looks OK.

The buffer_pool should be set to about 70% of available RAM if you are running InnoDB only.

The log size does not matter a lot. The optimal is to set it so that (Uptime * innodb_log_file_size / Innodb_os_log_written) is roughly 3600 (1 hour).

To change the log size, one must

  1. shut down mysqld cleanly
  2. delete the value in my.cnf (my.ini)
  3. delete the log files
  4. retstart -- new log files will be rebuilt.