--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.
--max-allowed-packet=#
If the option value is 2, the CHANGE MASTER TO statement is written as an SQL comment, and thus is informative only; it has no effect when the dump file is reloaded.
If the option value is 1, the statement is not written as a comment and takes effect when the dump file is reloaded.
If no option value is specified, the default value is 1.
如果选项赋值为2,那么CHANGE MASTER TO 语句会被写成一个SQL comment(注释),从而只提供信息;
如果选项赋值为1,那么语句不会被写成注释并且在dump被载入时生效。
如果没有指定,默认值为1。https://www.cndba.cn/hbhe0316/article/22702https://www.cndba.cn/hbhe0316/article/22702https://www.cndba.cn/hbhe0316/article/22702
[root@mysql57 data]# mysqldump -h127.0.0.1 -uroot -pwwwwww --single-transaction --set-gtid-purged=OFF --databases testdb --master-data=1 --triggers --events --routines> /tmp/testdb1_all_master.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
https://www.cndba.cn/hbhe0316/article/22702https://www.cndba.cn/hbhe0316/article/22702https://www.cndba.cn/hbhe0316/article/22702https://www.cndba.cn/hbhe0316/article/22702
[root@mysql57 data]# mysqldump -h127.0.0.1 -uroot -pwwwwww --single-transaction --set-gtid-purged=OFF --databases test --master-data=2 --triggers --events --routines> /tmp/test_all_master.sql
https://www.cndba.cn/hbhe0316/article/22702https://www.cndba.cn/hbhe0316/article/22702
版权声明:本文为博主原创文章,未经博主允许不得转载。
MYSQL