Insights and outlooks on software development

S'true

MySQL error when restoring large sets of data

Wednesday, May 14, 2008 by Thomas L

So there I was, humming along with doing some mysql administration, basically MySQL dump ('mysqldump -u username -p mydatabase table1 table2 > some_file.sql') and a restore ('mysql -u username -p someotherdatabase < some_file.sql'). Suddenly I got the error:

"ERROR 2006 (HY000) at line 123: MySQL server has gone away"

After some head-scratching and a couple of googlings, I found out that the crash happened since the inserts exceeded the max_allowed_packet size. The solution was to increase the max_allowed_packet from 1M to 16M, by editing my.ini for my MySQL installation.

This happened for a 4.1 MySQL instance; I don't know if it's fixed in later versions.

References:

http://bugs.mysql.com/bug.php?id=32543 (see post 7 Dec 2007 15:05)

See also http://dev.mysql.com/doc/refman/4.1/en/program-variables.html.

Filed under having  

0 kommentarer: