Fixed MySQL ERROR 1118 (42000) – Increase the redo log size using innodb_log_file_size.

How to fix MySQL ERROR 1118 (42000): increase innodb_log_file_size

In the previous article, we looked at how to import a large database into MySQL via the command line. During that process, you might hit another error:

ERROR 1118 (42000) at line 354585: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size.

Fortunately, the error message tells you exactly what to do. Here’s where to find the setting.

Problem: MySQL fails on import with ERROR 1118 (42000).

Solution:

Step 1. Stop MySQL (XAMPP example):

sudo /opt/lampp/./xampp stop

Step 2. Open /opt/lampp/etc/my.cnf and find the innodb_log_file_size line. The default is usually 5M — change it to something larger, like 30M. If the line isn't there, add it manually under the [mysqld] section.

Step 3. Start MySQL:

sudo /opt/lampp/./xampp start

In some cases, you'll also need to delete the old InnoDB log files before restarting. They are located at:

/opt/lampp/var/mysql/ib_logfile0
/opt/lampp/var/mysql/ib_logfile1

You can verify the change took effect by checking the file sizes — they should reflect the new value.

If the problem persists, check these additional settings in my.cnf and adjust them as needed:

key_buffer              = 256M
wait_timeout            = 28800
interactive_timeout     = 28800
max_allowed_packet      = 128M
table_open_cache        = 64
sort_buffer_size        = 512K
net_buffer_length       = 8K
read_buffer_size        = 256K
read_rnd_buffer_size    = 512K
myisam_sort_buffer_size = 8M

NOTE: innodb_log_file_size also affects write performance — a larger redo log reduces flush frequency. For local XAMPP development, 30–64 MB is usually enough. Production servers with large WooCommerce databases often need 256 MB or more. After changing the value, remember to delete the old log files (ib_logfile0, ib_logfile1) before restarting MySQL, otherwise MySQL will refuse to start.