MySQL itself proactively backs up batch commands:
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, you need environment variable settings
Mysqldump.exe program in the Bin folder of the MySQL installation folder
Set is a command for a batch set variable
%date:~,4% is a string that takes the date variable position 0 start length 4
%date:~5,2% is a string that takes the date variable position 5 start length 4
Weixin is the name of the database.
> behind is the output folder
Windows task scheduling implementation runs batches at a time interval
Execution ( 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 to the batch process to
Ability to manage task schedules in Task Scheduler
??
MySQL's own proactive backup