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. 【Linux】- Systemd 命令篇

    转自:阮一峰的网络日志 Systemd 是 Linux 系统工具,用来启动守护进程,已成为大多数发行版的标准配置. 一.由来 历史上,Linux 的启动一直采用init进程. 下面的命令用来启动服务. ...

  2. 自定义hive文件和记录格式及文本文件数据编码

    (1)一段 建表语句: [ROW FORMAT row_format] [STORED AS file_format] | STORED BY 'storage.handler.class.name' ...

  3. Python 内置函数&filter()&map()&reduce()&sorted()

    常用内置函数 Python 2.x 返回列表,Python 3.x 返回迭代器 在进行筛选或映射时,输出的结果是一个数组,需要list帮助. 如:print(list(map(lambda x:x+1 ...

  4. 并发编程 --进、线程池、协程、IO模型

    内容目录: 1.socket服务端实现并发 2.进程池,线程池 3.协程 4.IO模型 1.socket服务端实现并发 # 客户端: import socket client = socket.soc ...

  5. SharpDx

    layout category title permalink posts_by_category SharpDX SharpDX 系列 /post/sharpdx

  6. 2019-10-15-从以前的项目格式迁移到-VS2017-新项目格式

    title author date CreateTime categories 从以前的项目格式迁移到 VS2017 新项目格式 lindexi 2019-10-15 14:9:27 +0800 20 ...

  7. Linux网络编程 了解

    IPV4 -- IP地址分类:主机号是区分主机的,网络号是区分网段的 子网掩码是对主机号进行划分子网用的 举例说明: 对 192.168.1.0网段划分4个 其子网掩码 : 拿出主机号的两个位进行划分 ...

  8. pip3 常用操作

    清华大学pip镜像 https://mirrors.tuna.tsinghua.edu.cn/help/pypi/ # 设置为默认 pip install pip -U pip config set ...

  9. linux 磁盘与文件系统管理 (鸟哥私房菜)

    各种接口磁盘在Linux中的文件名分别为 /dev/sd[a-p][1-15]:为SCSI,SATA,USB,Flash随身碟等接口的磁盘文件名 /dev/hd[a-d][1-63]:为IDE接口的磁 ...

  10. XOR linked list--- 异或链表

    异或链表的结构 这是一个数据结构.利用计算机的的位异或操作(⊕),来降低双向链表的存储需求. ... A B C D E ... –> next –> next –> next –& ...