--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根据你输入的时间段来产生主 ...
随机推荐
- Python脚本轻松实现批量图片重命名
************************************************************************** 摘要:网上爬取的图片名字很混乱,格式也比较多,需要 ...
- 前端(十八)—— jQuery高级操作:选择器、文本属性与类、事件、文档操作、动画、结构关系
JQ选择器.文本属性与类.事件.文档操作.动画.结构关系 可参考jQuery的API文档 一.选择器 1.css语法匹配 标签 | 类 | id | 交集 群组 | 后代 | 兄弟 伪类 | 属性 $ ...
- DQL 数据查询语言 show
2.show show databases; 查看所有的库 show tables; 查看当前库的所有的表 show tables from database; 查看指定的库下的所有表 show pr ...
- Feign 系列(02)Why Feign
Feign 系列(02)Why Feign [toc] 1. 什么是 Feign Feign 的英文表意为"假装,伪装,变形", 是一个 Http 请求调用的轻量级框架,可以以 J ...
- windows IIS FTP 不支持创建多级目录
昨天因为这个事情搞了好久,因为客户那边使用的是IIS 上的FTP ,想着都差不多试着运行,结果竟然报错,说"错误550 文件不可用" 是在GetResponse()出现的异常,我用 ...
- UIPageViewController看这篇就够了
先说初始化 - (UIPageViewController *)PageViewController{ if(!_PageViewController){ //书脊位置,只有在UIPageViewCo ...
- 从零开始搭建系统2.4——Jenkins安装及配置
1.安装wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.reporpm --impo ...
- echats问题
echats 横轴显示不下datazoom配置,加入滚动条 实例博客 https://blog.csdn.net/Zheng_xiao_xin/article/details/80882113 常用 ...
- 6.Srust2结果页面跳转
1. 结果页面存在两种方式 * 全局结果页面 > 条件:如果<package>包中的一些action都返回success,并且返回的页面都是同一个JSP页面,这样就可以配置全局的结果 ...
- 在sublime上安装markdown插件(win10)
1.markdown插件安装 --ctrl+shift+p --在命令框中选中 package control:install package 选中它 按回车 --在命令框中输入 markdown, ...