replicate-rewrite-db
replicate-rewrite-db:
Tells the slave to translate the default database (that is, the one selected by USE) to to_name if it was from_name on the master.Only statements involving tables are affected (not statements such as CREATE DATABASE, DROP DATABASE, and ALTER DATABASE), and only if from_name is the default database on the master.This does not work for cross-database updates.To specify multiple rewrites, use this option multiple times.The server uses the first one with a from_name value that matches.The database name translation is done before the --replicate-* rules are tested.If you use this option on the command line and the “>” character is special to your command interpreter, quote the option value.For example:shell> mysqld --replicate-rewrite-db="olddb->newdb"
在Slave端的my.cnf中加入
replicate-rewrite-db=fandb->dudb
重启Slave库,然后首先要创建dudb这个库
(mysql@localhost)[fandb]> create table rewrite asselect*from ab;
[ERROR]Slave SQL:Error'Table 'dudb.ab' doesn't exist' on query. Default database: 'dudb'. Query: 'create table rewrite as select * from ab', Error_code: 11462015-07-10 09:44:58 48962 [Warning] Slave: Table 'dudb.ab' doesn't exist Error_code:11462015-07-1009:44:5848962[ERROR]Error running query, slave SQL thread aborted.Fix the problem, and restart the slave SQL thread with "SLAVE START".We stopped at log 'mysql-bin.000003' position 3973
mysql> show slave status\G***************************1. row ***************************Slave_IO_State:Waitingfor master to send eventMaster_Host:192.168.134.132Master_User: replMaster_Port:3306Connect_Retry:60Master_Log_File: mysql-bin.000003Read_Master_Log_Pos:4089Relay_Log_File: mysql-relay-bin.000002Relay_Log_Pos:283Relay_Master_Log_File: mysql-bin.000003Slave_IO_Running:YesSlave_SQL_Running:No
replicate-rewrite-db的更多相关文章
- Hadoop 之Mong DB 之CentOS 6 使用 yum 安装MongoDB及服务器端配置
安装MongoDB的方法有很多种,可以源代码安装,在Centos也可以用yum源安装的方法.由于MongoDB更新得比较快,我比较喜欢用yum源安装的方法.64位Centos下的安装步骤如下: 1.准 ...
- phpwind的rewrite重写原理
没有深入过pw,被人问到这方面的问题,搜索了一下,发现了一篇博文,但原博客已打不开. http://www.phpsoho.com/html/document/200608/1154750694.ht ...
- nginx 配置 ThinkPHP Rewrite
server { listen 80; server_name www.funsion.com; root /www/web/funsion; index index.php; location / ...
- trove,测试,db小解析
# Copyright 2014 Tesora Inc.# All Rights Reserved.## Licensed under the Apache License, Version 2.0 ...
- apache、nginx的虚拟域名配置和rewrite配置,以及web缓存的几种方式
web缓存一般用来缓解数据库压力. 通常有几种方法,文件静态化,缓存服务memcached.redis等. 伪静态,一般指在url上貌似访问静态html页的形式,这样有利于搜索引擎访问到网站页面,实际 ...
- The Architecture of Open Source Applications: Berkeley DB
最近研究内存关系数据库的设计与实现,下面一篇为berkeley db原始两位作为的Berkeley DB设计回忆录: Conway's Law states that a design reflect ...
- sqlt 之 分析 DB upgrade 导致SQL 性能下降 的方法 xplore
https://blog.csdn.net/lukeUnique/article/details/79331779 https://mauro-pagano.com/2014/10/27/when-t ...
- Azure Cosmos DB (四) 使用EF的SQL API 异地冗余
一,引言 上一篇文章中,我们介绍到使用了EF Core 与Cosmos DB SQL API 进行结合开发.同时,大家在开发过程中一定要记得EF Core 不支持Cosmos DB 的迁移.今天我们启 ...
- Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级
Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 5.安装Database软件 5. ...
- VS15 preview 5打开文件夹自动生成slnx.VC.db SQLite库疑惑?求解答
用VS15 preview 5打开文件夹(详情查看博客http://www.cnblogs.com/zsy/p/5962242.html中配置),文件夹下多一个slnx.VC.db文件,如下图: 本文 ...
随机推荐
- XE6移动开发环境搭建之IOS篇(1):准备安装材料(有图有真相)
网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 1.选择方案 --- ...
- 让finder显示路径
在控制台输入 defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES 重启finder即可.
- Linux 使用 su 切换用户提示 Authentication Failure 的解决方法
Ubuntu v14.04,使用 su 命令切换用户时报验证失败的错误 这个问题产生的原因是由于 ubuntu 系统默认是没有激活 root 用户的,需要我们手工进行操作,在命令行界面下,或者在终端中 ...
- auto,register,static分析
1.关键字auto auto是C语言中局部变量的默认类型,指明声明的变量在程序的栈上分配空间. 2.关键字static 指明变量的“静态”属性,局部变量存储在静态存储区: 文件作用标示符,只能在声明的 ...
- git branch 管理常用命令
查看本地分支 git branch * dev master *代表当前位于dev分支 查看远程分支 git branch --remote origin/dev origin/master 查看远程 ...
- PHP基于数组的分页函数(核心函数array_slice())
关于数组的分页函数,用数组进行分页的好处是可以方便的进行联合多表查询,只需要将查询的结果放在数组中就可以了以下是数组分页的函数,函数page_array用于数组的分页,函数show_array用于分页 ...
- 也说virtualbox下安装centos7
以前一直在VMware Workstation下安装虚拟机系统,这几天由于电脑被别人使用误升级为win10,而导致原来的LNMP不能使用,查找原因在于即使是最新的VM12.1.1也只是支持win8而已 ...
- MyBatis关联查询,表字段相同,resultMap映射问题的解决办法
问题描述:在使用mybatis进行多表联合查询时,如果两张表中的字段名称形同,会出现无法正常映射的问题. 问题解决办法:在查询时,给重复的字段 起别名,然后在resultMap中使用别名进行映射. 给 ...
- DIRECTORY_SEPARATOR 和 PATH_SEPARATOR的区别
DIRECTORY_SEPARATOR:目录分隔符,linux上就是’/’ windows上是’\’ PATH_SEPARATOR:路径分隔符,include多个路径使用,在win下,当你要in ...
- Explode TArray
function Explode(const Separator, S: string; Limit: Integer = 0): TArray;var SepLen : Integer; F, P ...