1. 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
  2. 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
  3. the slave should start replicating.
  4. 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
  5. 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.
  6. mysqldump导出数据时,当这个参数的值为1的时候,mysqldump出来的文件就会包括CHANGE MASTER TO这个语句,CHANGE MASTER TO后面紧接着就是file和position的记录,在slave上导入数据时就会执
  7. 行这个语句,salve就会根据指定这个文件位置从master端复制binlog。默认情况下这个值是1
  8. 当这个值是2的时候,chang master to也是会写到dump文件里面去的,但是这个语句是被注释的状态。
  9. master-data参数在建立slave数据库的时候会经常用到,因为这是一个比较好用的参数,默认值为1,默认情况下,会包含change master to,这个语句包含file和position的记录始位置。master-
  10. data=2的时候,在mysqldump出来的文件包含CHANGE MASTER TO这个语句,处于被注释状态
  11. dump出文件
  12. [root@aeolus1 c_learn]# mysqldump -uroot test --single-transaction --master-data=2 >master-data.sql
  13. 过滤出change master to信息
  14. [root@aeolus1 c_learn]# grep -i "change master to" master-data.sql
  15. -- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000012', MASTER_LOG_POS=107;
  16. 然后修改
  17. change master to  master_host='xx.xx.xx.xx',
  18. master_user='repl',
  19. master_password='repl',
  20. master_port=3306,
  21. master_log_file='mysql-bin.000012',
  22. master_log_pos=107;
  23. 然后slave从库执行
  24. mysql> change master to  master_host='xx.xx.xx.xx',
  25. master_user='repl',
  26. master_password='repl',
  27. master_port=3306,
  28. master_log_file='mysql-bin.000012',
  29. master_log_pos=107;

--master-data 的作用的更多相关文章

  1. HR数据抽取:通过 Read Master Data 转换规则读取时间相关主属性数据

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  2. QM模块包含主数据(Master data)和功能(functions)

    QM模块包含主数据(Master data)和功能(functions)   QM主数据   QM主数据 1 Material   Master MM01/MM02/MM50待测 物料主数据 2 Sa ...

  3. Article Master Data Deviation

    Site data – Logistics DC / Logistics Store Where is the reference site decided when you maintain the ...

  4. MS MDS系列之初始MS Master Data Service(微软主数据服务)

    背景介绍: 主数据服务(Master Data Services)是微软平台支持的主数据管理(MDM)平台.类似MDS这样的系统,如果后续维护得当,会给企业提供一个强大的中心数据库系统,来防止企业数据 ...

  5. 51单片机数组的定义方法(code与data的作用)

    转自:http://blog.sina.com.cn/s/blog_94994f7b01010s1h.html 数组前不加“code”或“data”,则默认将数组存放在程序存储器中:code 指定数据 ...

  6. jquery click事件的可选参数data的作用

    $("#ID").click({x:"value"},function (e) { alert(e.data.x); });

  7. unity3d工程下的data file作用

    projectData文件夹中的data file: 1. Player settings – globalgamemanagers and globalgamemanagers.assets fil ...

  8. XenServer master主机的作用

    https://wenku.baidu.com/view/a2d3f0a333d4b14e852468c9.html###

  9. pod update更新error: RPC failed; curl 18 transfer closed with outstanding read data remaining

    1. pod update 的时候出现下边的错误 error: RPC failed; curl 18 transfer closed with outstanding read data remai ...

  10. Generate Time Data(财务日期主数据)

        1. Generate the master data from the specific time frame that you are interested in根据你输入的时间段来产生主 ...

随机推荐

  1. JOGL图形形状

    图形对象 要访问程序特定于硬件和操作系统平台,以及其他语言编写,比如C和C++(原生应用)库,Java使用一种称为Java本地接口(JNI)编程框架的工作. JOGL内部使用此接口,如图中下面的图表来 ...

  2. CM集群管理

    用CM装完cdh 版本后,将不同机架的服务器已经认为拆掉网线,但是主机管理那边还是显示已经下载的服务器存在. 如图: 该怎么配置 node8 和node9会自动消失:     DataNode已经显示 ...

  3. 6.2_springboot2.x分布式整合Dubbo

    1.分布式应用 ​ 在分布式系统中,国内常用zookeeper+dubbo组合,而Spring Boot推荐使用全栈的Spring,Spring Boot+Spring Cloud. 分布式系统: 特 ...

  4. python调用tushare获取股票日线实时行情数据

    接口:daily 数据说明:交易日每天15点-16点之间.本接口是未复权行情,停牌期间不提供数据. 调取说明:基础积分每分钟内最多调取200次,每次4000条数据,相当于超过18年历史,具体请参阅本文 ...

  5. JS面向对象(二)---继承

    一.面向对象的继承 1.解析:在原有对象的基础上,略作修改,得到一个新的对象,并且不影响原有对象的功能 2.如何添加继承---拷贝继承 属性:call 方法: for in /* 继承:子类不影响父类 ...

  6. 【转】从SOA到微服务,企业分布式应用架构在云原生时代如何重塑

    摘要: SOA 采用中心化的服务总线架构,解耦了业务逻辑和服务治理逻辑:微服务架构回归了去中心化的点对点调用方式,在提升敏捷性和可伸缩性的同时,也牺牲了业务逻辑和服务治理逻辑解耦所带来的灵活性. 为了 ...

  7. 框架_mybatis2使用注解

    在dao中使用注解: package cn.dao; import cn.mepu.User; import org.apache.ibatis.annotations.Select; import ...

  8. php导出csv并保存在服务器,返回csv的文件路径

    <?php namespace app\common\controller; use think\Controller; use think\Db; class Csv extends Cont ...

  9. SSL/TLS工作原理

    以前已经介绍过HTTP协议和HTTPS协议的区别,这次就来了解一下HTTPS协议的加密原理. 为了保证网络通信的安全性,需要对网络上传递的数据进行加密.现在主流的加密方法就是SSL (Secure S ...

  10. apache httpd.conf alias

    参考 Apache alias目录配置 我的环境是 Ubuntu apache2,配置文件目录在 /etc/apache2/sites-available/000-default.conf 在这个配置 ...