always killed backup mysql using ssh putty

always killed backup mysql using ssh putty

Posted by: basketmen
Posted on: 2007-12-12 14:15:00


i usually backup mysql using ssh since a year ago and no problem follow this tutorial http://wiki.dreamhost.com/Backup_MySQL,

mysqldump --opt -uusername -ppassword -h yourMySQLHostname dbname > output.sql




but since a few time ago everytime i backup using ssh putty i always get killed message and i think backup file never completed


mysql file now about 600mb

what should i do to backup now, i dont want always get killed message


Re: always killed backup mysql using ssh putty

Posted by: rlparker
Posted on: 2007-12-12 14:18:00

Try running mysqldump "niced", and see if that helps. You can learn more about nice by looking at it's man page:

shellprompt$ man nice

--rlparker

Re: always killed backup mysql using ssh putty

Posted by: basketmen
Posted on: 2008-01-18 13:22:00

hi rlparker thank you for your answer, but i still dont understand what do you mean, i am still get this problem : always get killed message when backup using ssh, the sql file is 800mb and get bigger

do you mean running query like this

mysqldump niced --opt -uusername -ppassword -h yourMySQLHostname dbname > output.sql


Re: always killed backup mysql using ssh putty

Posted by: rlparker
Posted on: 2008-01-18 13:34:00

You are welcome, and I'm sorry you are still having troubles.

In reply to:

i still dont understand what do you mean, i am still get this problem : always get killed message when backup using ssh, the sql file is 800mb and get bigger

do you mean running query like this

mysqldump niced --opt -uusername -ppassword -h yourMySQLHostname dbname > output.sql


No, actually what I meant was something like this:

nice -19 mysqldump -uusername -ppassword -h yourMySQLHostname yourdbname > output.sql

--rlparker

Re: always killed backup mysql using ssh putty

Posted by: basketmen
Posted on: 2008-01-19 14:30:00

i am still get killed message when backup using ssh puty using this command

nice -19 mysqldump -uusername -ppassword -h yourMySQLHostname yourdbname > output.sql


my sql database are 800mb, but i get killed message when it just finished at 300-400mb, i try it 10 times but i still cannot completly finished the backup

any other suggest???

thank you before

Re: always killed backup mysql using ssh putty

Posted by: zylox
Posted on: 2008-01-19 15:06:00

The problem is probably that the dump takes too long an DH kills processes which run for a longer time (no persistent processes). I think you can also just dump certain tables from database using mysqldump. Maybe you could run a dump for each table in that database and split it up that way?

Jan

Re: always killed backup mysql using ssh putty

Posted by: eike
Posted on: 2008-01-19 15:09:00

Talk to the support folks about this using the web panel. They may be able to help you.

Alternatively, you may want to split up your database backups on a table-by-table basis.

Re: always killed backup mysql using ssh putty

Posted by: tregeagle
Posted on: 2008-01-19 20:52:00

Read up on using mysqldump on DH here:
wiki.dreamh...MySQL#Getting_a_Backup_From_the_Shell

Your problems might be related to any number of things, I'd suggest contacting support if you don't figure it out soon.

I've been using this mysqldump script for a while without any problems. It gets activated by Cron and then I have another script to make another back-up to another machine.

#!/bin/bash

# modify the following to suit your environment
export DB_BACKUP="/home/username/path/to/backups"
export DB_USER="username"
export DB_PASSWD="password"

# title and version
echo ""
echo "My weekly mySQL_backup"
echo "----------------------"
echo "* Rotating backups..."
rm -rf $DB_BACKUP/04
mv $DB_BACKUP/03 $DB_BACKUP/04
mv $DB_BACKUP/02 $DB_BACKUP/03
mv $DB_BACKUP/01 $DB_BACKUP/02
mkdir $DB_BACKUP/01

echo "* Creating new backup..."
mysqldump --user=$DB_USER --password=$DB_PASSWD --host=mysql.mydomain.com --all-databases |
bzip2 > $DB_BACKUP/01/mysql-`date +%Y-%m-%d`.bz2
echo "----------------------"
echo "Done"
exit 0

Tags: backup mysqlputty