在MySQL5.5/5.6里版本里,设置同步复制过滤,例如设置忽略掉test库的t2表,你需要在my.cnf配置文件里增加:replicate-ignore-table=test.t2必须重启mysql服务进
在MySQL5.5/5.6里版本里,设置同步复制过滤,例如设置忽略掉test库的t2表,,你需要在my.cnf配置文件里增加:
replicate-ignore-table=test.t2
必须重启mysql服务进程才能生效。
在MySQL5.7里,通过一个新的命令,可以支持在线动态修改,而不须重启mysql进程就生效。
Example:
CHANGE REPLICATION FILTER REPLICATE_DO_DB=(db1,db2);
CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB=(db1,db2);
CHANGE REPLICATION FILTER REPLICATE_DO_TABLE=(db1.t1);
CHANGE REPLICATION FILTER REPLICATE_IGNORE_TABLE=(db2.t2);
CHANGE REPLICATION FILTER REPLICATE_WILD_DO_TABLE=('db.t%');
CHANGE REPLICATION FILTER REPLICATE_WILD_IGNORE_TABLE=('db%.a%');
CHANGE REPLICATION FILTER REPLICATE_REWRITE_DB=((from_db, to_db));
增强了易用性,方便了不少。
参考:
本文出自 “贺春旸的技术专栏” 博客,请务必保留此出处
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn