MySQL logical backup

Source: Internet
Author: User

Logical backups are typically used for data migrations or data volumes, and logical backups are backed up by data exports.

If you need to export all databases, the command is as follows:

Mysqldump-uroot-p--single-transaction-a>all.sql

If you want to export only a few of these databases, use the following command:

Mysqldump-uroot-p--single-transaction-b test1 Test2>test1_test2.sql

If you are exporting a few tables in a library, you can use the following command:

Mysqldump-uroot-p--single-transaction-b test1--table table1 table2>table1_table2.sql

When you only need to export the table structure, use the following command:

Mysqldump-uroot-p--skip-triggers>all.sql

When you only need to export a stored procedure, use the following command:

Mysqldump-uroot-p-q-rtdn--skip-triggers

If you only need to export the trigger, you can use the following command:

Mysqldump-uroot-p-q-tdn--triggers

To export only the event is, take the following command:

Mysqldump-uroot-p-etdn--skip-triggers

To export data only, use the following command:

Mysqldump-uroot-p-Q--single-transaction--skip-triggers-t

To create a new slave online, please use the following command:

Mysqldump-uroot-p-Q--single-transaction--master-data=2-a >all.sql

MySQL logical backup

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.