views:

126

answers:

2

how can i use mysqldump

to backup and restore database to a remote server

both have root access

i am using putty

i tried this

mysqldump -u root -p >z*x311a!@ masdagn_joom15 | mysql \ -u root -p g2154hE6-AsXP --host=207.210.71.26 -C masdagn_joom15temp \g

but it refused

localpassword: >z*x311a!@

remote password: g2154hE6-AsXP

A: 
mysqldump --user=username --password=pwd db_name | bzip2 -c > /backup_dir/db_name.sql.bz2

you can embed this part in a script, afterward you can use FTP to transfer to the other location.

To restore, you can

bzip2 -d db_name.sql.bz2
mysql --user=username --password=pwd db_name < db_name.sql
grokus
A: 

This link provides information on backing up and restoring with mysqldump. It also gives some examples with a remote server.

NebuSoft
i am really using thisbut when i enter the command mysqldumpit gives me nothingonly the command prompt again
manhag