MySQL error 1153: Got a packet bigger than 'max_allowed_packet' bytes

4

When attempting to import a database from a dump with 1.2GB, the following error occurred:

  

ERROR 1153 (08S01) at line 727: Got a packet bigger than 'max_allowed_packet' bytes

The command I'm using for import is:

mysql -u usuario -p banco < dump.sql

How to solve this?

    
asked by anonymous 20.10.2014 / 22:04

1 answer

4

I found the answer in a answer by Michael Pryor on Stack Overflow in English .

According to him, it is necessary to change a MySQL configuration, and to pass an extra parameter to the client on the command line, setting a high heat to max_allowed_packet (it uses 100M ) .

Change in my.cnf (or my.ini in Windows)

max_allowed_packet=100M 

Alternatively, you can run the following commands on the server:

set global net_buffer_length=1000000; 
set global max_allowed_packet=1000000000;

Changing the client call

mysql --max_allowed_packet=100M -u usuario -p banco < dump.sql

(I rebooted the server before calling the client.)

    
20.10.2014 / 22:04