# Lost connection to MySQL server during query

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

<div class="post-metadata">

**Author:** ![jyotimy](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@jyotimy](https://forums.percona.com/u/jyotimy)\
**Post date:** [September 14, 2009, 2:14am UTC](https://forums.percona.com/t/lost-connection-to-mysql-server-during-query/1259/1 "2009-09-14T02:14:56Z")

</div>

Hi ,

I am trying to take Dump of a database which has around 4,334,714 records and size 559 MB.

But when I fire a Dump command I get an error “Lost connection to MySQL server during query”

I also tried to write a script where I try to limit my records and dump it in a separate temporary table but ended up with the same error.

I also tried to take compress dump using :  
mysqldump -u [USERNAME] -p [DBNAME] | gzip \> [/path\_to\_file/DBNAME].sql.gz

Is there any other way I can achieve this? Or what could be the reasons of mysql loosing the connection?

Thanks

---

<div class="post-metadata">

**Author:** ![sterin71](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sterin71](https://forums.percona.com/u/sterin71)\
**Post date:** [September 14, 2009, 8:06am UTC](https://forums.percona.com/t/lost-connection-to-mysql-server-during-query/1259/2 "2009-09-14T08:06:57Z")

</div>

Check the mysql error log (usually located in the data directory) or the syslog of your system!

My guess is that one of your tables might be corrupt and that is why your connection aborts when it tries to read it.
