Sometimes you might notice that when you are doing MySQL things on your remote server/local server Or else when you doing unit tests withs PHP you are getting this error Says,
Got a Packet bigger than “max_allowed_packet” bytes.
This is because of transferring payload size that is greater than allowed packet size in MySQL.So we can fix this easily.
All you have to do is increase the max_allowed_packet size from the MySQL configuration file.
How to find the configuration file.
Just add “max_allowed_packet=500M” or whatever size that your server can handle. Save the file and restart the MySQL server and You are done.
The second method is also simple. All you have to do is increase packet size using MySQL CLI. These sets of commands will increase your max_allowed_packet size in MySQL.
SET GLOBAL max_allowed_packet=10737418224;
These commands will increase your MySql Memory and fix your MySQL Got a Packet bigger than “max_allowed _packet” bytes Error.