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. PAT_A1075#PAT Judge

    Source: PAT A1075 PAT Judge (25 分) Description: The ranklist of PAT is generated from the status lis ...

  2. Chrome调试小技巧

    前言: 除了我们日常使用的调试方法,在Chrome中,其含有一些有意思的方法,有助于提高我们的开发调试效率. Sources页 command + p 文件跳转 使用Sublime的人或习惯用comm ...

  3. C# WinfForm 控件之dev报表 XtraReport (五) 并排报表

    有了前边的基础这个就很简单了,建一个容器报表 在detail,上放两个xrsubReport.再做两个明细报表,分别指定到xrsubreport就可以了

  4. YApi导入swagger生成的接口

    1.swagger的JSON地址,net或netcore开发环境下 2.配置在内网中,localhost请用对应的IP地址替换,在浏览器地址栏中输入以上地址,会返回一个json格式的文档 3.导入 4 ...

  5. sqlserver 如何瞬间执行上万条数据

    核心的内容是:使用自定义表类型 第一步:创建存储过程P_T1DeclareInfo_Upload_new 参数: T1DeclareInfo_UploadPNSN_Param  类型 T1Declar ...

  6. python——pandas基础

    参考: 实验楼:https://www.shiyanlou.com/courses/1091/learning/?id=6138 <利用python进行数据分析> pandas简介 Pan ...

  7. 从零开始搭建系统2.2——ELK安装及配置

    ELK 最新版本对JDK的最低要求是1.8,安装java_1.8版本 一.Elasticsearch 1.创建目录 2.下载安装包 wget https://artifacts.elastic.co/ ...

  8. JAVAWEB之文件的上传和下载

    一.文件的上传: Enctype的属性介绍: 基于表单文件上传的界面简介: 文件上传时服务器端获取不到请求信息的原因及获取请求信息的几种方式: 输入流方式的实现: 实用工具包的实现:要导入fileup ...

  9. Vue Router基础

    路由 安装 vue-router 起步 <router-link to="/foo">Go to Foo</router-link> <router- ...

  10. SpringBoot 之 Mybatis 逆向工程

    今天给大家介绍在 spring- boot 项目中如何使用 maven 插件逆向工程生成 Mybatis 代码. pom.xml 添加依赖和插件 <dependency> <grou ...