Automatic MySQL database backup on Windows Server
1. Grant all SQL permissions to the root account
Grant all privileges on *. * to root @ "%" identified ".";
Flush privileges;
2. create a bat batch file
@ Echo offset path = % path %; D:/Program Files/MySQL Server 5.5/binset y = % date :~ 0, 4% set m = % date :~ 5, 2% set d = % date :~ 8, 2% set h = % time :~ 0, 2% set cdate = % y % m % d % _ % h % mysqldump-h 127.0.0.1-u root -- password = *****-e-R -- database cmsis> f: /data/cmsis _ % cdate %. sqlexit
Cmsis is the database to be backed up. when the batch processing file is executed, a file such as cmsis_20140510_16. SQL is generated under f:/data.
3. add a scheduled task
(1) program-> accessories-> System Tools-> task plan-> Add Task plan
(2) click Next
Click browse to select the created bat file
(3) set the task execution time
Click next and enter the administrator password!