Daily Backup MySQL Database (Windows)

Create a batch file:

@echo off 
echo Running dump… 
C:\xampp\mysql\bin\mysqldump -u[username] -p[userpassword] –result-file=”d:\db_backup\backup.%DATE:~0,3%.sql” [databasename]
echo Done!

Replace [username], [userpassword] and [databasename]

 

Create a scheduled task to execute this .bat file daily

 

Done

 

Reference:

  • http://realm3.com/articles/how_to_schedule_regular_mysql_backups_in_windows
  • http://rritw.com/a/shujuku/Mysql/20130416/340978.html