The best way for Mysql to automatically back up the database in a timely manner (Windows Server) _mysql

Source: Internet
Author: User
Tags mysql automatic backup

There are many online Windows MySQL automatic backup method, but really can not use a few, some say is still very complex, difficult to operate.

We all know that MSSQL itself with a scheduled task can be used to automatically back up, but MySQL how do we automatically have backup?

Teach you one of the easiest ways.

This method is done with a bat batch.

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

As shown in figure:

Database name: 952game database backup destination: d:\db_bak\ (the path where you want to back up the database to which disk) I want to prepare the Db-bak directory in 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

As detailed in the diagram:

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

Here we take the simplest approach

Use Windows Scheduled Tasks to execute the batch script at timed intervals. (For example: Perform Back_db.bat 3 o'clock in the morning every day)

If not, please read the pictures and texts:

1, operation, planning tasks

2, add the scheduled task.

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

This is the time to complete the automatic scheduled backup, very simple.

The last little piece of the morning to give you more to say is this batch processing command \%date:~0,3% the meaning of the week to extract information
Of course, if you want to create the day of the year with%date:~0,10%, the system will give you a day to build a directory. It's very convenient.

%date:~0,10%//Extraction Date
%date:~-3%//Extract Week information
%time:~0,5%//extraction time and minutes
%time:~0,-3%//Extraction time and minute and second information

If it's still not, ask us to edit it. will be answered in detail for you. The most important thing is no charge! Ha ha. Feel good to help forward to your friends.

See this, Cloud Habitat Community Small series for everyone to share two free software, simpler and easier to use

Domestic Windows Server users can use:

Good security. Backup software free Edition (SQL Server, file automatic backup)

Please platform p8net MySQL management tools MyAdmin v1.0 (MySQL timed Backup tool)

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.