Morshed Alam
Morshed Alam Software Architect

Remote mysql backups on windows

• By Morshed Alam • MySql
In our day to day job needs to backup remote mysql database and sometimes may needs to synchronize with another one.

It can be done by using following code snippet, no matter the remote server is windows or Linux.

Save the following code snippet as a batch(.bat) file and setup a task scheduler.

set DATET=%date:~-4%_%date:~7,2%
"your mysql bin directorymysqldump" --host="remote-host" --user="remote-database-user" --password="remote database password" remote-database-name > "backup-directory"backup_%DATET%_csv.sql
"your mysql bin directorymysql" -uuser -ppassword -t csv < "backup-directory"backup_%DATET%_csv.sql
Tags: #MySql

Comments (0)

No comments yet. Be the first to share your feedback or ask a question!

Leave a Comment