5

I'm migrating data from magento 1.7.0.2 to Magento 2 and get the following error:

MySQL server has gone away

enter image description here

1
  • Please check your MySQL "wait_timeout" variable to make sure MySQL is not closing the database connection early.
    – user35138
    Commented Jan 15, 2016 at 17:40

1 Answer 1

7

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
3
  • 2
    Late to this party. Could you confirm with SELECT @@max_allowed_packet size is 4G? Most version documentation indicates the Range is up to 1G. Error log many indicate at startup a different max available. Commented Jul 4, 2018 at 0:26
  • I can't confirm this. Maybe it just uses the max value from 1GB when setting it to a bigger value. But 1GB will be way enough anyways.
    – bpoiss
    Commented Jul 4, 2018 at 9:32
  • @bpoiss can you confirm the path for my.cnf file. i am using xampp server. migration m1.9.3.6 to m2.3.3 Commented Jan 18, 2020 at 7:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.