You need to restart the MySQL server if you change such a setting.
You typically get "MySQL server has gone away" whenever you're trying to connect to the incorrect host. You need to tell us a bit more about your setup to help you further
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm running MySQL with DBngin and i get this error. It seems that laravel can't even connect to the database.
SQLSTATE[HY000] [2006] MySQL server has gone away
I saw that increasing the 'max_allowed_packet` the issue can be solved but i haven't found a way to do that in my case.
i downloaded mysql-client and after i connected to my database, i tried to set the max_allowed_packet
set global max_allowed_packet=16000000;
But for some reason it doesn't change, I checked that with
SHOW VARIABLES LIKE 'max_allowed_packet';
This can also be changed in the my.cnf file but because i am running MySQL with DBngin i couldn't find the configuration file. I know that i can set a custom configuration file in DBngin but i'm not sure what else i should include in that file besides the max_allowed_packet in order to make it work.
Any ideas ?
Please or to participate in this conversation.