I'm migrating data from magento 1.7.0.2 to Magento 2 and get the following error:
MySQL server has gone away
I had the same problem and solved it by increasing the following value in the /etc/mysql/my.cnf
mysql configuration file:
max_allowed_packet=4000M # just set it to 4000M because on my dev machine i don't care
Be carefull to not change the mysqldump option, there is also a max_allowed_packet
I also added this line to set the wait_timeout
in the same configuration file:
wait_timeout=6000