S S

CITY LINUX ®

Linux support on-site, on-line and in the cloud.

0793 572 8612

Systems Administration Notes.

MySQL database imports.


MySQL database imports.

When trying to create a database from an sql dump after a couple of thousand lines I would get the message "MySQL server has gone away (error 2006)"

Turns out this is common event caused by a packet being received that is larger than that set in the mysql configuration file (1MB by default when using the small, medium, large or even the huge model configuration file) This seems a little odd given that it is such a commonly reported problem. I also note that that the mysqldump maximum packet size is 16M for all models.

In addition to changing the configuration file /etc/mysql/my.cnf and signalling the running data base (kill -1), there is the option to change the value on the fly with the command set max_allowed_packet at the mysql command line.

MariaDB [(none)]> set global max_allowed_packet=16*1024*1024;

Clifford W Fulford
28 January 2016.



The layout and associated style sheets for this page are taken from the World Wide Web Consortium and used here under the W3C software licence.