If a replication source server does not write a statement to its binary log, the statement is not replicated. If the server does log the statement, the statement is sent to all replicas and each replica determines whether to execute it or ignore it.
On the source, you can control which databases to log changes for
by using the
--binlog-ignore-db options to
control binary logging. For a description of the rules that
servers use in evaluating these options, see
Section 18.104.22.168, “Evaluation of Database-Level Replication and Binary Logging Options”. You should not use
these options to control which databases and tables are
replicated. Instead, use filtering on the replica to control the
events that are executed on the replica.
On the replica side, decisions about whether to execute or ignore
statements received from the source are made according to the
--replicate-* options that the replica was
started with. (See Section 17.1.4, “Replication and Binary Logging Options and Variables”.)
In the simplest case, when there are no
--replicate-* options, the replica executes all
statements that it receives from the source. Otherwise, the result
depends on the particular options given.
--replicate-ignore-db) are checked
first; see Section 22.214.171.124, “Evaluation of Database-Level Replication and Binary Logging Options”, for a
description of this process. If no database-level options are
used, option checking proceeds to any table-level options that may
be in use (see Section 126.96.36.199, “Evaluation of Table-Level Replication Options”,
for a discussion of these). If one or more database-level options
are used but none are matched, the statement is not replicated.
For statements affecting databases only (that is,
DROP DATABASE, and
ALTER DATABASE), database-level
options always take precedence over any
In other words, for such statements,
are checked if and only if there are no database-level options
that apply. This is a change in behavior from previous versions of
MySQL, where the statement
dbx was not replicated if the replica had been started
To make it easier to determine what effect an option set has, it
is recommended that you avoid mixing
*-ignore-* options, or wildcard options with
options that do not employ wildcards.
options were specified, they are applied before the
--replicate-* filtering rules are tested.
In MySQL 5.6, all replication filtering options
follow the same rules for case sensitivity that apply to names
of databases and tables elsewhere in the MySQL server, including
the effects of the
This is a change from previous versions of MySQL. (Bug #51639)