Mysql – What does MySQL Error 2013 mean

MySQL

I'm running mysqldump on a mysql server in a cron (as backup) and I'm getting warning messages like

mysqldump: Got error: 2013: Lost connection to MySQL server during query when doing refresh

What does this MySQL error (2013) mean? I've done some googling and it's not very helpful…

For the record, mysqldump is connecting to a MySQL Slave server, it used to work when it was connecting to a master.

Best Answer

This could be very bad, 2013 means that the thread servicing the mysqldump process has died. This could be because the InnoDB engine on the server has detected an error while reading the database file for you database. As mysqldump has to read all the pages for all of your database to make the backup it is likely to trigger any latent corruption that your application may avoid during it day to day activity.

If you run your mysql command and it reports that your connection id is a low number then you server has probably restarted itself. You should check your mysqld.log immediately to find out why.