深圳全飞鸿

标题: mysqldump --master-data参数的作用 [打印本页]

作者: zhgc    时间: 2021-4-25 00:28
标题: 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.


1. 默认值是1

作者: zhgc    时间: 2021-9-8 23:07
不带值时的输出:
--master-data

--
-- Position to start replication or point-in-time recovery from
--

CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000770', MASTER_LOG_POS=106;

--
-- Current Database: `erp`
--




欢迎光临 深圳全飞鸿 (http://www.nagomes.com/disc/) Powered by Discuz! X3.2