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 To master_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 MA STER to master_log_file= ' mysql-bin.000007 ', master_log_pos=107;---> Change MASTER to Master_log_file= ' Mysql-bin.000007 ', master_log_pos=107;845c845<--dump completed on 2012-03-13 18:09:59--->--dump completed on 201 2-03-13 18:10:24 : A. The difference between =1 and =2 is obvious, but the difference between automatic execution and manual execution is b. --master-data forDump data on the master side, used to build Slave--dump-slave users dump data at slave end, create a new slave, at least 2nd slave, which is already a-->b, now export data from B to build a--> C replication This not only can be used to build slave, but also for backup, for reading Binlog to roll forward starting point   Note: 1. Already have A-&GT;B structure, want to build A->b & A->c, How do I back up using mysqldump mode? Use the Dump-slave parameter in the B library.  2. Already have a->b architecture, want to build a->b->c, how to use mysqldump way backup? Use the Master-data parameter in the B library.  3.--master-data, It turns on--lock-all-tables, unless Single-transaction also is specified

Differences 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.