The difference between Master-data and Dump-slave in mysqldump

Source: Internet
Author: User
Tags diff

[[email protected] ~]$ mysqldump-A--master-data=2 > Master2.sql

[[email protected] ~]$ mysqldump-A--dump-slave=2 > Slave2.sql

[[email protected] ~]$ mysqldump-A--master-data=1 > Master1.sql

[[email protected] ~]$ mysqldump-A--dump-slave=1 > Slave1.sql

[[email protected] ~]$ diff Master2.sql Master1.sql22c22< --Change MASTER to master_log_file= ' mysql-bin2.000001 ', master_log_pos=259;--->Change MASTER toMaster_log_file='mysql-bin2.000001', Master_log_pos=335; 845c845< --Dump completed on 2012-03-13 18:09:46---> --Dump completed on 2012-03-13 18:10:17

[[email protected] ~]$ diff Slave2.sql Slave1.sql22c22< --Change MASTER to master_log_file= ' mysql-bin.000007 ', master_log_pos=107;--->Change MASTER toMaster_log_file='mysql-bin.000007', Master_log_pos=107; 845c845< --Dump completed on 2012-03-13 18:09:59---> --Dump completed on 2012-03-13 18:10:24

There are:
A. The difference between a. = 1 and =2 is obvious, just the difference between automatic execution and manual execution
B.--master-data is used to dump data on the master end for establishing slave
--dump-slave users dump data at slave end, build a new slave, at least 2nd slave, which is already a-->b, now export data from B to build a-->c copy

This can be used not only for building slave, but also for backup, for reading Binlog The starting point of roll forward

Attention:

--master-data, It turns on--lock-all-tables, unless Single-transaction also is specified

The difference between Master-data and Dump-slave in mysqldump

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.