Symptoms

You will get the runtime error on log:

Error: Your MySQL server max_allowed_packet size is insufficient

Causes

This is not actually a bug but a control inside Prime Mover plugin to prevent the MySQL server Package too large error.
To explain this, when a string is imported to your MySQL database, the maximum bytes per packet that can be imported is controlled through a MySQL server setting called max_allowed_packet.

What happens is that when the database is restored by Prime Mover, there is a specific packet string that exceeds your MySQL server max_allowed_packet setting. When this happens, a runtime error is returned.

Solution

The solution is to increase the MySQL parameter max_allowed_packet value. Increase it in a way it is larger than the maximum bytes per packet. You need to increase the value (from the default which is 1MB) until there is no more error found. (e.g. start with 32MB and gradually increase this if necessary). This depends on your server. Suggestions are as follows:

XAMP Windows server – you can easily increase the max_allowed_packet setting value.
Please follow this tutorial: https://stackoverflow.com/questions/1679442/how-do-you-set-max-allowed-packet-in-xampp/1679486
Usually in Windows server, the MySQL configuration file is found in C:\xampp\mysql\bin\my.ini

You need to restart your XAMPP MySQL service to affect this change and make sure to set a high value to prevent error.

Linux server – You can change this setting by editing my.ini or ~/.my.cnf

More details of this solution here: https://stackoverflow.com/questions/8062496/how-to-change-max-allowed-packet-size

Note: If you don’t have access to these settings or does not know where to find this setting – please create a ticket with your web host and request them to increase this value.

Once the value is increased – try again doing the restore or export with Prime Mover and it should fix this error.

Update: Since Prime Mover 1.6.0 – it will auto-detect this error. It will auto-adjust the max_allowed_packet size value if the database user (used by WordPress) are granted with SUPER privileges or global privilege that allows setting this value.

If user does not have the privilege required – Prime Mover cannot auto-fix and the runtime error is returned. The only fix at this point is to contact the database administrator or hosting support and manually raise the max_allowed_packet size value in the MySQL database server.

Was this article helpful?
YesNo