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.

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.

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Leave a Reply

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

Notify of
Sort by:   newest | oldest | most voted

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


max_allowed_packet | 134217728

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