--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安装配置(Windows)
在本教程中,我们将学习 Gradle 的安装,对于一个初学者,有时安装开发环境也是一个比较麻烦的问题.如果按照 Gradle 官方网站的说明安装,则可能会遇到一些麻烦,有时还要在互联网上做一些搜索,查 ...
- Couleur(启发式 + 主席树)(终于补坑了)
ZOJ Problem Set - 4053 Couleur Time Limit: 6 Seconds Memory Limit: 131072 KB DreamGrid has an a ...
- 微信小程序支付之代码详解
微信小程序自带的一套规则,类似vue语法,但是好多功能都集成在api中,给了很多初学者轮子,所以首先要熟悉这些api,忘记可照官网继续开发 这里主要说下微信小程序的支付,原理类似上篇介绍的公众网页支付 ...
- python接口自动化(响应对象方法)
python接口自动化(响应对象方法) 一.encoding作用 获取请求的编码(在不设置响应编码时,响应的信息默认使用的是请求的编码格式):r.encoding 设置响应的编码:r.encoding ...
- Java中在磁盘上复制文件
使用字节流实现 public static void main(String[] args) throws IOException { InputStream in = new FileInputSt ...
- canvas的基础入门
canvas是定义在浏览器上的画布.它不仅仅是一个标签元素更是一个编程工具是一套编程的接口.利用它可以开发出很多东西,比如动画,游戏,动态的图表等富有变现力和感染力的应用.还可以开发出绚丽的3D动态效 ...
- 配置 jaco机械臂 ros环境
---恢复内容开始--- 终于有机械臂了, 首先先下载包 cd ~/catkin_ws/src git clone https://github.com/Kinovarobotics/kinova-r ...
- 读书笔记五--numpy
数组转置和轴对换 转置是重塑的一种特殊形式,返回的是源数据的视图(不会进行任何复制操作).数组不仅有transpose方法,还有一个特殊的T属性: arr=np.arange().reshape((, ...
- 深入研究js中的位运算及用法
什么是位运算? 位运算是在数字底层(即表示数字的 32 个数位)进行运算的.由于位运算是低级的运算操作,所以速度往往也是最快的(相对其它运算如加减乘除来说),并且借助位运算有时我们还能实现更简单的程序 ...
- 1.Struts2快速入门
Struts2是一个基于MVC设计模式的Web层框架 Web层框架的特点:前端控制器模式 快速入门 1.下载Struts2的框架包 https://struts.apache.org/ 2.导入jar ...