[[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->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