MySQL's own proactive backup

Source: Internet
Author: User
Tags time interval

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.