NuxOra – Linux and Oracle IT website

Admistration, configuration, déploiement, optimisation et tuning.

Transfer easily a Mysql Dump between two servers

#Dump of the master database
$ mysqldump -u user -p db_test > /var/dump/db_test.dat

#Copy the dump file db_test.dat with scp to the slave mysql database
$ scp /var/dump/db_test.dat user@nuxora.com:/var/backup/db_test.dat

#Restore database on the slave server from the master server
$ ssh user@nuxora.com ‘mysql -u user -p db_test < /var/backup/db_test.dat’

it is quite simple and efficient.

But if you are a real geek you’d prefer this one:

#Dump from master database to slave one with ssh
$ mysqldump db_test | ssh user@nuxora.com mysql db_test

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>