Beckham _ mysql database backup and recovery, _ mysql Database Backup

Source: Internet
Author: User

Beckham _ mysql database backup and recovery, _ mysql Database Backup
Mysql database backup and recoveryBrief:
I. Database Backup
2. database recoveryI. Database Backup

1. Simple backup Description: Incremental backup and overall backup during system operation

For example, a full backup is performed every Sunday, and the backup is performed from Monday to Saturday.

If a problem occurs on Friday, you can recover it on Sunday + Monday, two, three, and four.

2. Backup tools

A. Third-Party paid backup tools

B. The system's built-in backup function is mysqldump (you can export the database and table)

C. Use outfile and infile

2.1 examples of mysqldump

Example 1: export a table in a database

Mysqldump-u username-p Password Database Name Table 1 Table 2 Table 3> path/backup file name

Back up the t table in the mugua Database

(Note: the result of mysqldump is a series of SQL statements)

Example 2: How to export all tables in a database

Mysqldump-u username-p Password Database Name> path/backup file name

Back up all tables in the mugua Database

 

Example 3: How to export data in a database

Mysqldump-u username-p password-database B database 1 Database 2 database 3> path/backup file name

 

Example 4: How to export all databases

Mysqldump-u username-p password-A> path/backup file name

 

Summary:

1. mysqldump exports SQL statements.

2. Other usage of mysqldump

A. mysqldump: export the structure of the t table in the mugua Database


B. mysqldump: export the data in table t of the mugua Database

 

2.2 Use outfile and infile

(Note: outfile exports data from all columns of table t)

 

2. database recovery

1. operate on the command line

Mysql-u username-p password [database name] <path/backup file name

1.1 restore the t table in the mugua Database

,


1.2 restore the mugua1 Database



2. log on to mysql and use the source operation.

2.1 restore the t table in the mugua Database


(Source is equivalent \.)

 

2.2 restore the mugua1 Database



The quieter you become, the more you are able to hear!

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.