深圳全飞鸿

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 608|回复: 1
打印 上一主题 下一主题

mysqldump --master-data参数的作用

[复制链接]

800

主题

1379

帖子

7704

积分

版主

Rank: 7Rank: 7Rank: 7

积分
7704
跳转到指定楼层
楼主
发表于 2021-4-25 00:28:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
--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
回复

使用道具 举报

800

主题

1379

帖子

7704

积分

版主

Rank: 7Rank: 7Rank: 7

积分
7704
沙发
 楼主| 发表于 2021-9-8 23:07:42 | 只看该作者
不带值时的输出:
--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`
--
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|nagomes  

GMT+8, 2025-5-4 23:56 , Processed in 0.023038 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表