The best method for mysql automatic and timed database backup-windows system supported

Source: Internet
Author: User
Tags mysql backup

There are a lot of methods for automatic MySQL backup under windows on the Internet, but there are not a few that can be used, some of which are still very complicated and difficult to operate.

We all know that MSSQL itself comes with scheduled tasks that can be used for automatic backup,But how do we have automatic backups for mysql?

PC6 teaches you the simplest way.

This method is completed using bat batch processing.

Hypothetical environment:MySQL installation path: D: \ Program Files \ mysql \ MySQL Server 5.0 \ data

 

Database Name: 952game Database Backup destination: D: \ db_bak \ (path of the disk to which you want to back up the database) under the DB-Bak directory where I want to backup D, ======================== 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

Details:

The best step is to implement regular backup! Go go

Here we use the simplest method

Run the batch processing script on a scheduled task in windows. (For example, execute back_db.bat at every day)

If not, view the text:

1. Run and Schedule Tasks

2. Add a scheduled task.

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

 

 

Now we have completed automatic and scheduled backup. It's easy.

Finally, the pc6.com editor will give you an additional explanation in the early morning. This batch processing command \ % Date :~ 0, 3% indicates the week information.
If you want to create a date, use % Date :~ At, the system will create a date directory for you every day. It's very convenient.

% Date :~ 0, 10% // extract year, month, and day Information
% Date :~ -3% // extract the day of the week
% Time :~ // Extract time and minute in time
% Time :~ 0,-3% // extract time and minute and second Information

If you still don't want to, come to pc6.com and ask us to edit it. Will answer your questions in detail. The most important thing is no charge! Haha. I think pc6 can help you forward it to your friends.

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.