Today after receiving this error I was able to fix the problem using the following solution. The command line examples below were executed on a Ubuntu Server. I received the error [Err] 2006 - MySQL server has gone away from my MySQL server when executing a large SQL file to import data. To fix this error / problem I first create a backup copy of the MySQL configuration file: # cp -v /etc/mysql/my.cnf /etc/mysql/my.cnf.BAKNext, edit the configuration file: # nano /etc/mysql/my.cnfChange the max_allowed_packet settings to a higher value: [mysqld]
# change to 64M
max_allowed_packet = 64MRestart your MySQL server: # service mysql restartOptional: if the above setting didn't work you can also try setting the wait_timeout setting (in seconds), for example: [mysqld]
wait_timeout = 600Don't forget to restart the MySQL server if this change is made.