Increase maximum query size max_allowed_packet for MySQL

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,
   max_allowed_packet=1073741824
  or
   max_allowed_packet=1G
4.Now Restart MySQL Server.

 

MySQL server has gone away

Increase maximum query size max_allowed_packet for MySQL- MySQL has gone away error

For this “MySQL server has gone away” error, above method is the solution.

 

NOTE:
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';

The following two tabs change content below.
I am Karthik, software engineer by profession. You can find and follow me, from Social Media or here. Google+

Latest posts by karsho (see all)

This entry was posted in Wamp.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please Fill this Sum * Time limit is exhausted. Please reload the CAPTCHA.