1

I have followed all the steps in this link to set-up MySQL Master-Master replication for two database servers.

The master-master replication works fine.

Here is my my.cnf file, which contains some additional configuration than that present in the above link for auto-increment:

server-id = 1
replicate-same-server-id = 0
auto-increment-increment = 10
auto-increment-offset = 1

log_bin = "/var/lib/mysql/mysql-bin.log"
binlog_do_db = my_employee_database

log-slave-updates

expire_logs_days = 20

binlog_format = mixed

Similarly this is set-up in the other node with some changes.

my_employee_database has 4 tables:

  1. my_employee
  2. my_company
  3. my_address
  4. my_audit.

Question

Is there a way I can ignore or stop or remove the table my_audit from being replicated among the two server nodes and have the replication run normally for the other 3 tables as it is?

Environment

Database: MySQL 5.6.25
OS: CentOS 6.5 64 bit

2

Yes you can, simply add replicate-ignore-table in your my.cnf . please refer following link for mysql documentation :

https://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html#option_mysqld_replicate-ignore-table

  • 2
    You will have to restart mysql for the changes in my.cnf to take into effect. In MySQL 5.7 replication-filter variables are dynamic. – mysql_user Aug 4 '15 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.