tike tike - 2 months ago 13
MySQL Question

filter mysql replication (ignore-db)

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

i.e.

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.

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

Answer

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

replicate-ignore-db is a slave-side setting, it tells the Slave to ignore incoming log information related to the listed 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 datababases (minus those possibly excluded by binlog-ignore-db, i.e. database that will not be replicated anywhere).

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 being a system database, it should be ignored from both ends, unless you really, really really know what you are doing).