Home  >  Article  >  Database  >  Mysql automatic backup

Mysql automatic backup

高洛峰
高洛峰Original
2016-12-02 13:53:141050browse

Batch processing 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_backweixin_%Ymd%_%hMs%.sql

Command explanation

To use mysqldump, you need to set it up The environment variable

Mysqldump.exe program is in the bin directory of the mysql installation directory.

Set is a command to set variables in batches.

%date:~, 4% is a string of length 4 starting from position 0 of the date variable.

% date:~5,2% is a string of length 4 starting from position 5 of the date variable

weixin is the name of the database

> followed by the output directory

Windows task plan implements batch processing every once in a while

Run (Win+R) Enter taskschd.msc to open the task scheduler


Click on the task scheduler library

There is a Create Basic Task on the right side


Step by step


Finally enter the batch process Just follow the path


You can manage the task plan in the task scheduler


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Mysql advanced triggersNext article:Mysql advanced triggers