
Recently I was backing up a large MySql database (several hundred megabytes), using the awesome MySqlHotCopy script, when I started getting the following error:
DBD::mysql::db do failed: MySQL server has gone away at mysqlhotcopy line 528.
I have no clue what that error means. mysqlhotcopyworked great on all of my other smaller databases. I did a little searching on my old friend google, and after sniffing around a bit, I came up with a resolution to the problem… the script was timing out, so I just had to increase the allowed time in the /etc/my.cnf file.
Here are the steps I took
pico /etc/my.cnf
add these lines to the file:
interactive_timeout = 3600
wait_timeout = 3600
save file
/etc/init.d/mysqld restart
I ran mysqlhotcopy again, and everything worked and the backup was made.














{ 1 comment… read it below or add one }
Thank you! I was completely baffled by this error until you clued me in that it was a timeout. I put in 3600 and got a good run.
3600 (one hour) seems like a bit much, though.
mysqlhotcopy ended with:
Copying 362 files…
Copying indices for 0 files…
Unlocked tables.
mysqlhotcopy copied 120 tables (362 files) in 162 seconds (171 seconds overall).
So for me 180 seconds (3 minutes) looks like plenty. I’m so happy I now know where to look in case of future “mysql server has gone away”.