MySQL: ERROR 2006 (HY000) MySQL server has gone away

ERROR 2006 (HY000:) MySQL server has gone away.

Generally, when we are dealing with large column’s queries and values, MySQL raises this kind of error.

max_allowed_packet:
To resolve this error, we should look into this parameter of MySQL Server.

Whenever we require to process big binary string like BLOB column, we should increase the value of this variable.

The solution of this error is to increase the value of max_allowed_packet parameter.
The default value is 16MB.

You can add below line into my.cnf file:

After this change, You must restart the MySQL service.

Anvesh Patel

Leave a Reply

3 Comments on "MySQL: ERROR 2006 (HY000) MySQL server has gone away"

Notify of
avatar
Sort by:   newest | oldest | most voted
Muni
Guest

I have increased max allowed packet to 128MB, Still I am facing the same issue

Fyi…

max_allowed_packet | 134217728

>>>>>>>>>>>>>>>>>>
mysql> select 134217728/1024/1024;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect…
<<<<<<<<<<<<<<<<<<

wpDiscuz