Lost connection to MySQL server during query

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

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.