Some case we have to change the maximum query size of MySQL using max_allowed_packet Variable. Solution of this thing is the solution for “MySQL server has gone away” Error.
1. Open my.ini or my.cnf file under MySQL part under th WAMP Folder.
2. Search max_allowed_packet variable. If variable not found, just add it.
3. change the value as need. For example, to set 1GB,
4.Now Restart MySQL Server.
MySQL server has gone away
For this “MySQL server has gone away” error, above method is the solution.
1. Until the MySQL server restarts, set the value globally. For example, to set 1GB
SET GLOBAL max_allowed_packet=1073741824;
2. Check the current MySQL server maximum query size,
SHOW VARIABLES LIKE 'max_allowed_packet';