过滤 mysql 复制 (ignore-db)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18830964/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 18:51:42  来源:igfitidea点击:

filter mysql replication (ignore-db)

mysqldatabase-replication

提问by tike

mysql ignore-db works according to server my.cnf AFAIK,

mysql ignore-db 根据服务器 my.cnf AFAIK 工作,

i.e.

IE

binlog-ignore-db                        = mysql
replicate-ignore-db                     = mysql

I am not sure, if this works from client side too, can anyone explain the mechanism, how can i be able to send from master but not accept in client side.

我不确定,如果这也适用于客户端,任何人都可以解释该机制,我如何能够从主服务器发送但不能在客户端接受。

Why i want to do this? I have multiple slave "2 slave" must replicate MySQL table where as in other 2 should not be overwriten. Where as every other table will be replicated.

为什么我要这样做?我有多个从站“2 从站”必须复制 MySQL 表,而其他 2 个表不应被覆盖。将复制所有其他表的位置。

Reading this: http://dev.mysql.com/doc/refman/5.6/en/replication-rules-db-options.htmldidnt make me clear enough.

阅读这个:http: //dev.mysql.com/doc/refman/5.6/en/replication-rules-db-options.html 并没有让我足够清楚。

回答by RandomSeed

binlog-ignore-dbis a master-side setting, it tells the Master not to log changes taking place on the listed DB.

binlog-ignore-db是一个主端设置,它告诉主不要记录在列出的数据库上发生的更改。

replicate-ignore-dbis a slave-side setting, it tells the Slave to ignore incoming log information related to the listed DB

replicate-ignore-db是一个从端设置,它告诉从端忽略与列出的数据库相关的传入日志信息

The typical use case is when you want to replicate different databases from one single Master to different Slaves. The Master must log all changes occurring in all databases (minus those possibly excluded by binlog-ignore-db, i.e. database that will not be replicated anywhere).

典型的用例是当您想将不同的数据库从一个 Master 复制到不同的 Slaves 时。Master 必须记录所有数据库中发生的所有更改(减去那些可能被 排除的更改binlog-ignore-db,即不会在任何地方复制的数据库)。

Each Slave will receive the full binary log, but will only replicate changes related to the selected databases (i.e. databases notexcluded by replicate-ignore-db-- this list would be different on each Slave).

每个 Slave 将收到完整的二进制日志,但只会复制与所选数据库相关的更改(即排除的数据库replicate-ignore-db- 此列表在每个 Slave 上都不同)。

(mysqldatabase being a system database, it should beignored from both ends, unless you really, really reallyknow what you are doing).

mysql数据库是一个系统数据库,从两端都应该忽略它,除非你真的,真的真的知道你在做什么)。