Detailed Mysql automatic backup and recovery of several methods (graphics and text tutorial) _mysql

Source: Internet
Author: User
Tags mysql automatic backup

Automatic backup MySQL 5.0 has three scenarios:

Backup Scenario One: generate a complete. sql file directly through the mysqldump command

Step 1: Create a batch

(Note: Root is the MySQL default user name, AAAAAA is the MySQL password, bugtracker is the database name)

------------Mysql_ Backup.bat--------------------------------------------------------------------------------------

D:
cd d:/appserv/mysql/bin
mysqldump-uroot-paaaaaa bugtracker > e:/database/mysql_bugtracker_backup/ Bugtracker_back.sql
exit

Step 2: Create a scheduled task

"Start"--> "Control Panel"--> "Administrative Tools"--> "Task Scheduler"

"Create a Basic Task"-->---> "daily" (note the time after setting)-->----"Start a program"--> "Browser" (Locate select the batch you just created Processing Mysql_backup.bat)-->---> "Finish"

The corresponding Restore method

To create a process:

----------Mysql_restore.bat-------

D:
cd d:/appserv/mysql/bin
mysql-uroot-paaaaaa bugtracker < e:/database/mysql_bugtracker_backup/ Bugtracker_back.sql
exit

Double-click it to automatically perform a restore

Backup scenario Two: Through the Xcopy command, directly to the MySQL data directory of the corresponding database all the files copy out

To create a batch process:

xcopy D:/appserv/mysql/data/bugtracker e:/database/mysql_bugtracker_backup/bugtracker//e/h/d/y/r/v 
exit

The corresponding Restore method

Copy the BugTracker folder in the E:/database/mysql_bugtracker_backup directory directly to the D:/appserv/mysql/data directory and cover all the BugTracker folders in the directory.

Backup Scenario Three: Install Navicat for MYSQL tool, set up automatic backup through its Schedule feature

Schedule--> New Batch Job

Select your DB (Eg:bugtracker) in the new pop-up page, and then in the right-hand panel (Available Jobs) you will see "Backup BugTracker" and double-click it to appear on the bottom panel---

Attach a few pictures (full procedure)

First step:

Second Step

Third Step

Fourth Step

Fifth Step

Sixth step

Seventh Step

The corresponding restore method:

Locate the latest. psc file in the above directory and then restore it via the Navicat for Mysql tool

Attach some pictures of the procedure

First step

Part II

Third Step

Fourth Step

Fifth Step

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.