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. pandas读取文件出现路径不存在的问题

    我写的路径是绝对路径,其他的文件读写完全是没有问题的但是pandas就是不行,于是我改写为全路径:'E:/Python/KNN/iris.csv' 即可解决

  2. wordpress 上传图片时提示“无法建立目录wp-content/uploads/2019/03。有没有上级目录的写权限?”

    查一下网站目录下wp-content目录的权限, # ls -l drwxr-xr-x  5 nobody 65534  4096 Feb  3  2016 wp-content 修改wp-conte ...

  3. PROJECT | 四则运算UI设计 - 项目总结

    [项目Github地址] https://github.com/oTPo/hw2 [项目规划] PSP表格 事项 预计时间(min) 实际花费时间(min) 需求分析 60 60 开发流程分析 30 ...

  4. tty - 显示连接标准输入的终端的文件名

    总览 (SYNOPSIS) tty [OPTION]... 描述 (DESCRIPTION) 显示 连接 标准输入 的 终端 的 文件名. -s, --silent, --quiet 什么 都 不显示 ...

  5. Linux 守护进程创建

    1. 守护进程: 是Linux中的后台服务进程.它是一个生存期较长的进程,通常独立于控制终端并且周期性的执行某种任务或等待处理某些发生的事件.守护进程常常在系统启动时开始运行,在系统关闭时终止 2. ...

  6. one-hot encoding与哑变量的区别

    one-hot encoding与哑变量的区别 one-hot比哑变量的特征位多一位,即哑变量是精简版的one-hot,即在线性回归中用截距项来表示最后一维,但由于最初很难分辨特征的主次关系,且机器学 ...

  7. 防HTTP慢速攻击的nginx安全配置

    概述   慢速攻击,是一种ddos攻击的变体版本.通常来说,它通过向服务器发送正常的请求,只不过请求的头或者请求体的内容特别长,发送速度有特别慢,这样每一个连接占用的时间就会变得特别长,攻击者会在短时 ...

  8. H5调用百度地图导航

    template <div class="map"> <div class="content_flex"><img src=&qu ...

  9. 模拟字典序排序——hdu6034

    #include <bits/stdc++.h> #include <iostream> using namespace std; ; ; int n; int maxj; s ...

  10. NX二次开发-获取当前part所在路径UF_PART_ask_part_name

    #include <uf.h> #include <uf_ui.h> #include <uf_part.h> #include <atlstr.h> ...