--master-data 的作用
- 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文件里面去的,但是这个语句是被注释的状态。
- master-data参数在建立slave数据库的时候会经常用到,因为这是一个比较好用的参数,默认值为1,默认情况下,会包含change master to,这个语句包含file和position的记录始位置。master-
- data=2的时候,在mysqldump出来的文件包含CHANGE MASTER TO这个语句,处于被注释状态
- dump出文件
- [root@aeolus1 c_learn]# mysqldump -uroot test --single-transaction --master-data=2 >master-data.sql
- 过滤出change master to信息
- [root@aeolus1 c_learn]# grep -i "change master to" master-data.sql
- -- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000012', MASTER_LOG_POS=107;
- 然后修改
- change master to master_host='xx.xx.xx.xx',
- master_user='repl',
- master_password='repl',
- master_port=3306,
- master_log_file='mysql-bin.000012',
- master_log_pos=107;
- 然后slave从库执行
- mysql> change master to master_host='xx.xx.xx.xx',
- master_user='repl',
- master_password='repl',
- master_port=3306,
- master_log_file='mysql-bin.000012',
- master_log_pos=107;
--master-data 的作用的更多相关文章
- HR数据抽取:通过 Read Master Data 转换规则读取时间相关主属性数据
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- QM模块包含主数据(Master data)和功能(functions)
QM模块包含主数据(Master data)和功能(functions) QM主数据 QM主数据 1 Material Master MM01/MM02/MM50待测 物料主数据 2 Sa ...
- Article Master Data Deviation
Site data – Logistics DC / Logistics Store Where is the reference site decided when you maintain the ...
- MS MDS系列之初始MS Master Data Service(微软主数据服务)
背景介绍: 主数据服务(Master Data Services)是微软平台支持的主数据管理(MDM)平台.类似MDS这样的系统,如果后续维护得当,会给企业提供一个强大的中心数据库系统,来防止企业数据 ...
- 51单片机数组的定义方法(code与data的作用)
转自:http://blog.sina.com.cn/s/blog_94994f7b01010s1h.html 数组前不加“code”或“data”,则默认将数组存放在程序存储器中:code 指定数据 ...
- jquery click事件的可选参数data的作用
$("#ID").click({x:"value"},function (e) { alert(e.data.x); });
- unity3d工程下的data file作用
projectData文件夹中的data file: 1. Player settings – globalgamemanagers and globalgamemanagers.assets fil ...
- XenServer master主机的作用
https://wenku.baidu.com/view/a2d3f0a333d4b14e852468c9.html###
- 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 ...
- Generate Time Data(财务日期主数据)
1. Generate the master data from the specific time frame that you are interested in根据你输入的时间段来产生主 ...
随机推荐
- 前端(十五)—— JavaScript事件:绑定事件方式、事件的冒泡和默认事件、鼠标事件、键盘事件、表单 事件、文档事件、图片事件、页面事件
JS事件:绑定事件方式.事件的冒泡和默认事件.鼠标事件.键盘事件.表单 事件.文档事件.图片事件.页面事件 一.事件的两种绑定方式 1.on事件绑定方式 document.onclick = func ...
- opencv 打开摄像头(c++)
1,打开视频文件 2,打开IP摄像头 读取大华摄像头 大华的网络摄像头编号:DH-IPC-HFW1225M-I1-0600B,用的是RTSP协议. "rtsp://admin:dahua@1 ...
- NIO 源码分析(03) 从 BIO 到 NIO
目录 一.NIO 三大组件 Channels.Buffers.Selectors 1.1 Channel 和 Buffer 1.2 Selector 1.3 Linux IO 和 NIO 编程的区别 ...
- Solr6.6环境安装及core的创建(win7环境)
1.下载solr6.6 并解压 地址: http://www.apache.org/dyn/closer.lua/lucene/solr/6.6.0 2.安装JDK1.8 地址: http://www ...
- hadoop系列(二)分布式文件系统HDFS
根据core-site.xml的配置,接下来就可以通过:hdfs://localhost:9000来对hdfs进行操作了. 1.创建输入目录 C:\WINDOWS\system32>hadoop ...
- python 基本输入输出
- 配置 jaco机械臂 ros环境
---恢复内容开始--- 终于有机械臂了, 首先先下载包 cd ~/catkin_ws/src git clone https://github.com/Kinovarobotics/kinova-r ...
- [转]sourceforge文件下载过慢
sourceforge文件下载过慢,可以用下面网址镜像下载, 通过 下载Sourceforge等国内无法下载站点文件的另一种方法博文,好像主站点是 https://www.mirrorservice. ...
- jQuery - 事件相关
<script> $(function() { // 事件绑定 // 第一种方式 $("#btn").click(function() { alert("1 ...
- Ruby 安装 – Windows
Ruby 安装 – Windows 下面列出了在 Windows 机器上安装 Ruby 的步骤. 注意:在安装时,您可能有不同的可用版本. - Window 系统下,我们可以使用 RubyInstal ...