I have a 2 GB database dump which I am trying to import into mysql. When I run the import, I get the following:

> mysql -u myUser -p < dbDump.sql
Warning: option 'max_allowed_packet': unsigned value 104856551424 adjusted to 2147483648
Error 2006 (HY000) at line 2835: MySQL server has gone away

My max_allowed_packet is currently set to


I've googled for this issue and some users reported this issue being fixed by changing the wait_timeout value. The problem is that my dump times out in less than 5 seconds, so I don't think that wait_timeout is the problem.

Any other ideas about why my dump is failing?

[RESOLVED]: At stolsvik's suggestion, I checked the dump file for the contents of line 2835. I found if contained the command set global max_allowed_packet=200 which nullified the larger value I set earlier. I removed the offending line from and now the dump completes successfully.

  • 1
    What's at line 2835, then? And the server, is it still up after you've tried to execute this db dump? – stolsvik Feb 23 '12 at 14:55
  • That's a good idea to check the line contents. When I opened up the dump file, I found a line which was executing 'set global max_allowed_packet=200' which nullified my larger value. I've removed it from the file and now the dump completes successfully. thanks. – David Feb 23 '12 at 15:05
  • Please add your comment into an answer, so that you can mark this question as closed. – user3463 Feb 24 '12 at 0:14

The Warning is because your max_allowed_packet is WAY too big. You could try to just set it directly to what it adjusts it to, 2147483648, which apparently is 204MB. But do you really have that huge BLOBs in your db-dump?

Reference about max_allowed_packet.

  • Actually 2147483648 Bytes is 2048MB or 2GB. – Pit 2 days ago

Consider checking the contents of the mysql dump file in your favorite editor. Focus on line 2835 as the server specifically mentions it in the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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