MySQL – Setup mirror image of active db

I use this command to sync my active db to a backup db server. I just have to ensure that the user executing the cron job has secure ssh setup to the remote server

mysqldump -uroot -pPassword database_name | ssh backupserver.domain.com mysql -uroot -pPassword database_name
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s