# receiving Lost connection to MySQL server during query

**URL:** <https://forums.percona.com/t/receiving-lost-connection-to-mysql-server-during-query/1890>\
**Category:** Other MySQL® Questions\
**Created:** [September 8, 2012, 8:46am UTC](https://forums.percona.com/t/receiving-lost-connection-to-mysql-server-during-query/1890 "2012-09-08T08:46:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbro](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rbro](https://forums.percona.com/u/rbro)\
**Post date:** [September 8, 2012, 8:46am UTC](https://forums.percona.com/t/receiving-lost-connection-to-mysql-server-during-query/1890/1 "2012-09-08T08:46:14Z")

</div>

Since upgrading to Percona MySQL 5.5 from the default MySQL a month ago, I’m receiving the error “Lost connection to MySQL server during query” at times. I never experienced them with the default MySQL from [mysql.com](http://mysql.com).

I’m seeing them in 2 places:

1. Loading a mysqldump backup into a new database via “mysql -u root -p test \< backup.sql” where I’ll receive an error on a CREATE TABLE or an INSERT:

ERROR 2013 (HY000) at line 92: Lost connection to MySQL server during query  
ERROR 2006 (HY000) at line 92: MySQL server has gone away  
ERROR 2006 (HY000) at line 92: MySQL server has gone away

1. Running a SELECT statement in the mysql client where I’ll receive an error:

ERROR 2013 (HY000): Lost connection to MySQL server during query  
ERROR 2006 (HY000): MySQL server has gone away  
No connection. Trying to reconnect…

I’m running with log\_warnings=2 and in both cases, the following gets logged in the mysql error log:

120908 9:46:49 [Warning] Aborted connection 3390 to db: ‘test’ user: ‘root’ host: ‘127.0.0.1’ (Got an error reading communication packets)

I’m running CentOS 5.8 x86\_64. My current tests are using the RPM’s for Percona 5.5.24-26.0, but I have run into it on 5.5.25a-27.1 too. In each case, the client is running on the server itself and is connecting to the server at 127.0.0.1 via TCP - my my.cnf has

[client]  
host = 127.0.0.1  
port = 3306  
password

I haven’t been able to create a reproduce script because the errors are intermittent, and if I re-run the failed statements, they usually work the 2nd time. I noticed this bug which could be related - [URL=“https&#58;&#47;&#47;[bugs.launchpad.net/percona-server/+bug/925343](http://bugs.launchpad.net/percona-server/+bug/925343)”][https://bugs.launchpad.net/percona-server/+bug/925343[/URL]](https://bugs.launchpad.net/percona-server/+bug/925343%5B/URL%5D).

Are there other ways that I can narrow down what is causing this problem?

Thanks,  
Ryan

---

<div class="post-metadata">

**Author:** ![rbro](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rbro](https://forums.percona.com/u/rbro)\
**Post date:** [September 8, 2012, 10:03am UTC](https://forums.percona.com/t/receiving-lost-connection-to-mysql-server-during-query/1890/2 "2012-09-08T10:03:11Z")

</div>

From discussion in the above launchpad bug, the issue is related to resizing the terminal window while the query is running ([URL][MySQL Bugs: #62578: mysql client aborts connection on terminal resize](http://bugs.mysql.com/bug.php?id=62578%5B/URL%5D)). In my case, I’m running putty on Windows connecting to a CentOS machine. From my testing, I can only reproduce it using Percona 5.5.27-28.1. I cannot reproduce it with MySQL 5.5.27 from [mysql.com](http://mysql.com).
