Mysql issue with importing database through phpMyAdmin

While migrating a customer website from one webhoster to another hoster we got the following error message:

MySQL Error 1153 - Got a packet bigger than 'max_allowed_packet' bytes

Or in dutch

MySQL fout 1153 - Groter pakket ontvangen dan 'max_allowed_packet'

What this error means is that your server is not configured to accept big insert/update queries for your database. Normally this is not a issue because the value ‘max_allowed_packet’ has a default value of 16777216 bytes / 16 MB.

This means that if your insert query is inserting data that is bigger then defined size you get this error.

There are two solutions for this problem:

  1. Delete the row from the original table before export
  2. Change the defined size of ‘max_allowed_packet’ to a bigger value and try importing again

The row that gave problems in this export was a row with the option_name of “_site_transient_tenweb_auth_error_logs”. This row is being used by the plugin “10Web Booster – Website Speed optimization, Cache & Page Speed optimizer” for logging authentication errors.

A simple query to help you fix this issue with this plugin is as follows

-- Delete row from table wp_options
DELETE FROM `wp_options` WHERE `option_name` = '_site_transient_tenweb_auth_error_logs';

-- Insert new row in table wp_options
INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload`) VALUES (NULL, '_site_transient_tenweb_auth_error_logs', 'a:0:{}', 'no')