2011-04-22

Mysql - Error about packet too big while importing sql database












Q : While importing database in mysql, an error message pops out "ERROR 1153 (08S01) at line 232: Got a packet bigger than 'max_allowed_packet' bytes"
E.g.
$ mysql5 -u db_user -p db_table < db_table.sql 
Enter password: 
ERROR 1153 (08S01) at line 232: Got a packet bigger than 'max_allowed_packet' bytes
A : The file importing contains a statement that's probably too big, increase the value "max_allowed_packet" in my.cnf: E.g.
max_allowed_packet = 1M
to
max_allowed_packet = 2M
To find out where's my.cnf in FreeBSD, check out the help page :
mysql --help
and look for the below passage :
Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf /usr/local/etc/mysql/my.cnf ~/.my.cnf
As for macports, similarly
mysql5 --help 
E.g. :
Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /opt/local/etc/mysql5/my.cnf ~/.my.cnf
Ciao !!!

No comments: