mysql --master-data 参数

90 篇文章 30 订阅 ¥39.90 ¥99.00
本文介绍了在使用mysqldump时`--master-data`参数的作用,它用于创建从属服务器的备份文件,包含CHANGE MASTER TO语句,指定了主服务器的二进制日志坐标。当值为1时,该语句在导入时生效,为2时则作为注释。文章还演示了如何使用此参数进行数据导出,并展示了如何编辑和应用CHANGE MASTER TO语句来设置复制。
摘要由CSDN通过智能技术生成
Use this option to dump a master replication server to produce a dump file that can be used to set up another server as a slave of the master. It causes the dump output to 

include a CHANGE MASTER TO statement that indicates the binary log coordinates (file name and position) of the dumped server. These are the master server coordinates from which 

the slave should start replicating.
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 takes effect when the dump file is reloaded. If the option value is not specified, the default value is 1.

mysqldump导出数据时,当这个参数的值为1的时候,mysqldump出来的文件就会包括CHANGE MASTER TO这个语句,CHANGE MASTER TO后面紧接着就是file和position的记录,在slave上导入数据时就会执

行这个语句,salve就会根据指定这个文件位置从master端复制binlog。默认情况下这个值是1
当这个值是2的时候,chang master to也是会写到dump文件里面去的࿰
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

scan724

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值