After adding a second block type to an existing matrix field, we started receiving a "General error: 2006 MySQL server has gone away" error when additional content was saved to the new block type (screenshot attached). This error was shown in the CP and on the front-end. I was also unable to export the database via Sequel Pro.

This error only occurred on production- for some reason development and staging were fine.

I have since fixed production by restoring an earlier version of the database. We're now able to add content to the new matrix block type.

In trying to figure out what caused this error, I came upon the max_allowed packet setting.

The MySQL docs say:

Both the client and the server have their own max_allowed_packet variable, so if you want to handle big packets, you must increase this variable both in the client and in the server.

According to this SO post, SHOW VARIABLES LIKE 'max_allowed_packet' tells me that the server value is 64mb.

So I have two questions.

  1. How do I see the current client value of max_allowed_packet (I understand that the docs say it's 16mb by default).
  2. Is it necessary to adjust the client value in the context of running a Craft site? Or does that only apply if I'm manually using the CLI?

enter image description here

  • I'm getting same error. I tried all the way which i can do but problem not solved. Have you found any clue to solve this ? Aug 1 at 4:37

1 Answer 1


max_allowed_packet isn't the only thing that can cause a "MySQL server has gone away" error.

wait_timeout is another common one but, unfortunately, it's a generic error that MySQL throws for many things.

The MySQL docs have a whole page dedicated to those things worth checking out: https://dev.mysql.com/doc/refman/8.0/en/gone-away.html

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.