--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根据你输入的时间段来产生主 ...
随机推荐
- Gradle任务
Gradle构建脚本描述一个或多个项目.每个项目都由不同的任务组成.任务是构建执行的一项工作.任务可以是编译一些类,将类文件存储到单独的目标文件夹中,创建JAR,生成Javadoc或将一些归档发布到存 ...
- Windows7下命令行使用MySQL
我在Win7下安装的MySQL版本是mysql-5.0.22-win32 1.在Win7环境下安装MySQL,关于安装方法可以参考文章: Win7系统安装MySQL5.5.21图解教程.win7安装M ...
- Ubuntu12.04下安装sourcenavigator-NG4.5阅读源代码
大家知道Windows下有一个很好的查看源代码的软件sourceinsight,使用sourceinsight查看Linux内核代码.嵌入式软件开发中的C语言项目源代码.驱动程序代码很是方便.在Lin ...
- 人人开源打包jar
先在renren-security执行mvn clean install 再到renren-admin目录下,执行mvn clean package,就可以打成renren-admin.jar 如果想 ...
- 一分钟开启Tomcat https支持
1.修改配置文件 打开tomcat/conf/server.xml配置文件,把下面这段配置注释取消掉,keystorePass为证书密钥需要手动添加,创建证书时指定的. <Connector p ...
- vue中wath的源码实现
前言 阅读本节,需要理解vue的数据驱动原理. 看这样一段代码 new Vue({ data: { msg: 'hello', say: 'hello world', }, watch: { msg( ...
- 在vue中获取不到canvas对象? 两种解决办法。
1. mounted 钩子函数 初次肯定获取到id 2. 如果canvas父级用到了v-if 请改成v-show ,vue Dom节点 重新渲染导致methods 方法获取不到对象.
- dubbo源码学习(四):暴露服务的过程
dubbo采用的nio异步的通信,通信协议默认为 netty,当然也可以选择 mina,grizzy.在服务端(provider)在启动时主要是开启netty监听,在zookeeper上注册服务节点, ...
- 微信1.8.6.1 SDK 无法授权登录解决办法
我用的cocos2d-lua 3.9 项目打包 调用微信授权登录的时候 授权登录接口一直抛异常导致微信都无法拉起来 按照官网配置了universal link (这个也搞了很长时间jason 配置文件 ...
- VS2013 蛋疼的“AJAX Control Toolkit”安装过程
1.AJAX Control Toolkit 下载问题 方法一. 在vs2013中 工具->NuGet程序包管理器->管理解决方案的NuGet程序包 搜索 ajax z找到 AjaxCon ...