Solution for: MySQL server has gone away at mysqlhotcopy line 528

by Josh Highland on January 19, 2009

mysql logo Solution for: MySQL server has gone away at mysqlhotcopy line 528

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.

  • digg Solution for: MySQL server has gone away at mysqlhotcopy line 528
  • facebook Solution for: MySQL server has gone away at mysqlhotcopy line 528
  • stumbleupon Solution for: MySQL server has gone away at mysqlhotcopy line 528
  • twitter Solution for: MySQL server has gone away at mysqlhotcopy line 528
  • delicious Solution for: MySQL server has gone away at mysqlhotcopy line 528
  • reddit Solution for: MySQL server has gone away at mysqlhotcopy line 528
  • friendfeed Solution for: MySQL server has gone away at mysqlhotcopy line 528
  • posterous Solution for: MySQL server has gone away at mysqlhotcopy line 528
  • tumblr Solution for: MySQL server has gone away at mysqlhotcopy line 528

{ 1 comment… read it below or add one }

1 Coly Moore October 29, 2009 at 11:31 pm

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”. :D

Leave a Comment

Previous post:

Next post: