Mysql logical backup _ MySQL

Source: Internet
Author: User
Mysql logical backup bitsCN.com

Mysql logical backup

The syntax of mysqldump is as follows:

Mysqldump [arguments]> file_name

To back up all databases, use the -- all-databases option:

Mysqldump -- all-databases> dump. SQL

If you want to back up the specified database, you can use the -- databases option:

Mysqldump -- databases db1 db2 db3> dump. SQL

To back up the test architecture, use the following statement:

Mysqldump -- single-transaction test> test_backup. SQL

Use the -- single-transaction option to ensure backup consistency.

-- Single-trasaction: run the start transaction command before the backup starts to obtain the backup consistency. Currently, this parameter is only valid for the InnoDB storage engine. When this parameter is enabled and backed up, make sure that no other DDL statements are executed, because consistency cannot isolate DDL statements.

-- Add-drop-database: The drop database parameter must be used with the-all-databases or-databases option before the create database operation. By default, the exported text file does not contain the create database unless you specify this parameter.

BitsCN.com

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.