MySQL Error- a packet is bigger than max_allowed_packet bytes

  • When bulk importing SQL data via the command line using mysql, the import fails because the data is too large.

  • From the mysql command prompt:

set global net_buffer_length=1000000;
 set global max_allowed_packet=1000000000;
  • Keep the mysql prompt open

  • Run the SQL import from another shell

mysql mydatabase < /mydatabase-2009.07.22.sql
categories: mysql |