How to filter statements in MySQL slave replication?

How to filter statements in MySQL slave replication?

In MySQL Replication, users can filter statements either at master (using –binlog-* startup options) or at the slave (using –replicate-* startup options). Prior to MySQL-5.7.3, users could set these filtering rules either through command line parameters or by using my.cnf file.

What does ignore DB mean in MySQL replication?

Each Slave will receive the full binary log, but will only replicate changes related to the selected databases (i.e. databases not excluded by replicate-ignore-db — this list would be different on each Slave). ( mysql database being a system database, it should be ignored from both ends, unless you really, really really know what you are doing).

What are the rules for replication in MySQL?

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. Reading this: http://dev.mysql.com/doc/refman/5.6/en/replication-rules-db-options.html didnt make me clear enough.

How to change the replication channel in MySQL?

The CHANGE REPLICATION FILTER statement supports the FOR CHANNEL clause to configure channel specific filters online. The –replicate-* command options to configure filters can specify a replication channel using the form –replicate- filter_type = channel_name: filter_details .

How are channel based filters added in MySQL?

Any global replication filter specified is added to the global replication filters of the filter type ( do_db , do_ignore_table, and so on). Any channel specific replication filter adds the filter to the specified channel’s replication filters for the specified filter type.

How does a channel specific replication filter work?

Any channel specific replication filter adds the filter to the specified channel’s replication filters for the specified filter type. Each replication channel copies global replication filters to its channel specific replication filters if no channel specific replication filter of this type is configured.

Which is the highest priority filter in MySQL?

MySQL provides 3 levels of filters for setting up replication: Binary log, DB and Table. The binlog filters apply on the master to control how to log the changes. Since MySQL replication is based on the binlog, it is the first level filter and has the highest priority.