mysqldump --master-data

  --master-data[=#]   This causes the binary log position and filename to be
                      appended to the output. If equal to 1, will print it as a
                      CHANGE MASTER command; if equal to 2, that command will
                      be prefixed with a comment symbol. This option will turn
                      --lock-all-tables on, unless --single-transaction is
                      specified too (in which case a global read lock is only
                      taken a short time at the beginning of the dump; don't
                      forget to read about --single-transaction below). In all
                      cases, any action on logs will happen at the exact moment
                      of the dump. Option automatically turns --lock-tables
                      off.


这个导致binary log position and filename 追加到输出。

如果等于1, 会打印它作为一个CHANGE MASTER command;

如果等于2, 那么命令会前缀一个注释符号。

这个选项会设置 --lock-all-tables,除非 --single-transaction  也被指定(在这种情况下 一个全局的read lock 是设置一个较短的时间

在dump开始,不要忘记阅读关于 --single-transaction)

在所有的情况下,任何action 记录会发生在dump的准确时刻

原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199345.html