做主从配置的时候,要用mysqldump把数据导出,这时可以用master-data来记录当前的log-bin位置
其中
master-data=1导出来是这样:
---- Position to start replication or point-in-time recovery from
--
CHANGE MASTER TO MASTER_LOG_FILE='.000001', MASTER_LOG_POS=507;
--
-- Table structure for table `zh_user`
--
master-data=2导出来是这样:
---- Position to start replication or point-in-time recovery from
--
-- CHANGE MASTER TO MASTER_LOG_FILE='.000001', MASTER_LOG_POS=507;
--
-- Table structure for table `zh_user`
--
1和2的区别是,前者会自动CHANGE MASTER TO,后者要手动