MySQL database backup and recovery

Source: Internet
Author: User
ArticleDirectory
    • 2.1 Back up a single database
    • 2.2 recovery of a single database
    • 3.1 back up multiple databases
    • 3. 2. Restore multiple databases

References

Reference 1: http://blog.csdn.net/feng_sundy/article/details/3496744

Reference 2: http://www.cnblogs.com/lxJack/archive/2011/05/22/2053270.html

Reference 3: http://blog.csdn.net/xw13106209/article/details/6608706

1. Preface

I have previously written about the backup and recovery of Oracle databases. For details, refer to Section 3. If MySQL is used today, I will also understand the backup and recovery of MySQL.

MySQL uses the mysqldump command for database backup and MySQL Command for restoration.

2. Back up a single database
 
Del F: \ database_backup \ mysql_backup \ bugdb. SQL mysqldump-Uroot-Proot bugdb>F: \ database_backup \ mysql_backup \ bugdb. SQL

The preceding commands are divided into two steps. The first step is to delete the original script of bugdb data, and the second is to back up the data of bugdb to the SQL script bugdb. SQL.

2.2 recovery of a single database
 
MySQL-Uroot-Proot bugdb<F: \ database_backup \ mysql_backup \ bugdb. SQL
3. The instance 23.1 backs up multiple databases.
Del F: \ database_backup \ ngx_backup \ ngx_db7.sqlren F: \ database_backup \ ngx_backup \ ngx_db6. SQL ngx_db7. SQL ren f: \ database_backup \ ngx_backup \ mongodeff: \ database_backup \ ngx_backup \ mongof: \ database_backup \ ngx_backup \ ngx_db3. SQL ngx_db4.sqlren F: \ database_backup \ ngx_backup \ ngx_db2. SQL ngx_db3.sqlren F: \ database_backup \ ngx_backup \ ngx_db. SQL ngx_db2.sqlmysqld-Uroot-Proot--Database ngx_ad ngx_authority ngx_jbpm ngx_mes ngx_model> F: \ database_backup \ ngx_backup \ ngx_db. SQL

The -- database option is used in the mysqldump command, followed by multiple database names. For details, refer to section 1.

3. 2. Restore multiple databases
MySQL-Uroot-Proot<F: \ database_backup \ ngx_backup \ ngx_db. SQL

Because multiple databases are restored, no specific database is specified here. It is different from instance 1.

 

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.