# MySQL server has gone away

**URL:** <https://forums.percona.com/t/mysql-server-has-gone-away/4403>\
**Category:** Other MySQL® Questions\
**Created:** [September 17, 2015, 6:34am UTC](https://forums.percona.com/t/mysql-server-has-gone-away/4403 "2015-09-17T06:34:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kpaskal](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@kpaskal](https://forums.percona.com/u/kpaskal)\
**Post date:** [September 17, 2015, 6:34am UTC](https://forums.percona.com/t/mysql-server-has-gone-away/4403/1 "2015-09-17T06:34:25Z")

</div>

Hello,

I am using MariaDB version 10.x with binary logs

after the mysql server has been backup with innobackupex

1- i ran an insert into table… select … statement containing blobs . 19121 rows are generated.

2- shutdown the db , move it to another folder xmysql

3- restore the db with innobackup to a new mysql folder

4- run mysqlbinlog on the binary logs in xmysql (parameters used: --disable-log-bin) to a file mybinlog

5- run mysql --max\_allowed\_packet=2147483648 --binary-mode \<mybinlog , try also inside mysql source mybinlog

6- i got MySQL server has gone away

i tried the same process after insert into table… select … limit 5 , all is working fine

it seems that the huge quantity of rows with blob causes the issue ,how i can solve this ?

Thanks for your help

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [September 17, 2015, 10:06am UTC](https://forums.percona.com/t/mysql-server-has-gone-away/4403/2 "2015-09-17T10:06:15Z")

</div>

Hi kpaskal;

Generally a “server gone away” during import error is either max\_allowed\_packet or wait\_timeout related. I see that you are setting your max\_allowed\_packet for the mysql client to 2G (though the max is 1G, so it should default back to that), but what is your server value of max\_allowed\_packet set to? The import will be limited by whichever one of those is the lowest, so if your server is set to the default, then that is likely the issue. After that I would check the wait\_timeout value on your server and increase that if it is set to something smaller than the default.

All that aside, the MySQL manual has a pretty good page on this issue that may help:  
[url][https://dev.mysql.com/doc/refman/5.5/en/gone-away.html[/url]](https://dev.mysql.com/doc/refman/5.5/en/gone-away.html%5B/url%5D)

-Scott

---

<div class="post-metadata">

**Author:** ![cachedb](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@cachedb](https://forums.percona.com/u/cachedb)\
**Post date:** [June 5, 2016, 2:51am UTC](https://forums.percona.com/t/mysql-server-has-gone-away/4403/3 "2016-06-05T02:51:09Z")

</div>

Hi Scott:

I met the " MySQL server has gone away" problem when I tried to apply the binlog to a test database in order to update its data. I had three binlog files and one of them is 2G and the others are 1G approximately. After I met the problem, I set the “max\_allowed\_packet” to 1G and the “wait\_timeout” to 2880000, but I got the error still. Is there anything I can do to solve it? BTW, my database version is MySQL 5.6.25.

---

<div class="post-metadata">

**Author:** ![umarzuki](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/umarzuki/32/1064_2.png) [@umarzuki](https://forums.percona.com/u/umarzuki)\
**Post date:** [June 7, 2016, 1:04am UTC](https://forums.percona.com/t/mysql-server-has-gone-away/4403/4 "2016-06-07T01:04:52Z")

</div>

have you tried mysqltuner-perl?

mysqltuner.com
