[Turn]mysql the best way to automatically schedule backups of a database-support for Windows systems

Source: Internet
Author: User
Tags mysql automatic backup

There are a lot of internet on the Windows MySQL automatic backup method, but really can use not a few, some say is also very complex, difficult to operate.

We all know that MSSQL itself has its own schedule tasks can be used for automatic backup, but how do we automatically have a backup of MySQL?

This method is done using the bat batch process.

Hypothetical environment: MySQL installation Location: D:\Program files\mysql\mysql Server 5.0\data

The database name is: 952game database backup destination: d:\db_bak\ (the path of the disk you want to back up the database to) I'd like to have the Db-bak directory on the D-Disk ============================ new Db_ Bak.bat, write the following code

net stop MySQL

xcopy C:\mysql\data\bbs\*.* d:\db_bak\bbs\%date:~0,3%\/y

net start MySQL

Detailed

The best step is to realize how to regularly backup, with me to learn! Go Go Go

Here we take the simplest approach

Use the Windows Scheduled tasks to execute the batch script at timed intervals. (ex: Daily 3 o'clock in the morning execution of Back_db.bat)

If not, please read the text:

1, run, scheduled tasks

2. Add a scheduled task.

3, the last step is to specify the backup time.

It is easy to complete the automatic scheduled backup here.

Finally, let's say one more word about this batch command \%date:~0,3% the meaning of extracting the day of the week information
Of course, if you want to create years and days of the words with%date:~0,10%, the system will give you a daily directory of the date. It's very convenient.

%date:~0,10%//Extract date information
%date:~-3%//Extract Day of the week information
Time and minutes in%time:~0,5%//extraction Time
%time:~0,-3%//extract time and minute and second information

[Go]mysql the best way to automatically schedule backups of a database-support for Windows systems

Related Article

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.