MySQL Automatic backup Batch command:
Set "ymd=%date:~,4%%date:~5,2%%date:~8,2%"
Set "hms=%time:~,2%%time:~3,2%%time:~6,2%"
Mysqldump-uroot--password=password weixin> D:\mysql_back\weixin_%Ymd%_%hMs%.sql
Command explanation
To use mysqldump to set environment variables
Mysqldump.exe program in the bin directory of the MySQL installation directory
Set is a command for a batch set variable
%date:~,4% is a string that takes the date variable position 0 starting at length 4
%date:~5,2% is a string that takes the date variable position 5 starting at length 4
Weixin is the name of the database.
> behind is the output directory
Windows Task scheduling implementation performs batch processing at a time interval
Run ( Win+r ), enter Taskschd.msc Open Task Scheduler
Click Task Scheduler Library
Right there's a basic task to create
Step by step with
Finally, enter the path of the batch process to
Task Scheduler can be managed in Task Scheduler
MySQL Automatic backup