Home > Database > Mysql Tutorial > body text

Mysql automatic backup

高洛峰
Release: 2016-12-02 13:53:14
Original
1082 people have browsed it

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


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!