• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

mysqldump: Error 2013: Lost connection to MySQL server during query

#1
Hi,
When I wana copying xenforo_db to newxenforo_db for testing purpose using putty following ssh command:

Code:
mysqldump -uDB_user -p=DB_pass -hDB_host xenforo_db | mysql -uDB_user -pDB_pass -hDB_host newxenforodb
Initially i got max_allowed_ packet error...

after googling i changed the command as :

Code:
mysqldump --opt -max_allowd_packet=1G -uDB_user -p=DB_pass -hDB_host xenforo_db | mysql -uDB_user -pDB_pass -hDB_host newxenforodb
and this time i got the error:

mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `xf_post` at row: 334751
The numbers are always different in each error log.

I am confused how to change net_write_timeout and net_read_ timeout using ssh.

i have godaddy shared hosting

Can anyone help?
 

MattW

Well-known member
#3
Rather than piping it straight into a new DB, why not just output the DB to a file, and then re-import separately?

mysqldump --opt -max_allowd_packet=1G -uDB_user -p=DB_pass -hDB_host xenforo_db > db.sql

mysql -uDB_user -pDB_pass -hDB_host newxenforodb < db.sql
 
#4
Rather than piping it straight into a new DB, why not just output the DB to a file, and then re-import separately?

mysqldump --opt -max_allowd_packet=1G -uDB_user -p=DB_pass -hDB_host xenforo_db > db.sql

mysql -uDB_user -pDB_pass -hDB_host newxenforodb < db.sql
Thanks @MattW for reply...
in this case i received following error:
Code:
ERROR 1034 (HY000) at line 3209: 22 when fixing table
My sourceDb has 151 tables but when i backup & restore through godaddy built-in db import export procedure.. every time only 94 tables were restored...

I have also made ticket to godaddy twice but no email / responce received from supporting team since 82 hours..

Any one help me .. because i wana testing the update procedure before upgrading live forum on xf 1.2.x
 
#5
now i am using godaddy corn job through bash command line Schedule backup but receiving error of :

mysqldump: Got errno 32 on write
/var/chroot/home/content/USER/html/_db_backups/backupfolder/mysqlbackup_script.sh: line 110: 29061 Exit 5 /usr/bin/mysqldump -h $DBHOSTNAME -u $DBUSERNAME -p$DBPASSWORD $DBNAME
29062 CPU time limit exceeded | gzip > $BACKUPFOLDER/$DBNAME'_'`date '+%m-%d-%Y'`'_'$TODAY.sql.gz
Any One help please..

@Brogan @Jake Bunce