1

I need to make an everyday backup of a mysql database that is very big on a remote server and I only want to get the difference since the last backup. I also need to exclude some tables from being backed up. I've setup the mysql server as a master, here is the important part of my.cnf i've changed :

log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100M binlog_do_db = my_database

Then on the backup server i've setup mysql my.cnf like this :

replicate-ignore-table = my_db_name.my_table_name

To test that everything is ok, I do the following:

On Master:

$ mysql -u root -p MariaDB [my_database]> insert into my_table (param1, param2, ...) values(1, 1, ...) MariaDB [my_database]> exit $ scp /var/log/mysql/mysql-bin.00000X vagrant@backupserver:/tmp/

On Slave:

$ mysqlbinlog mysql-bin.00000X | mysql -u root -p

When I check the slave database I always see the new entry in the table, but that's not the expected result....

I must miss something, any idea ?

3

The replicate-ignore-table filter applies only the streaming over replication protocol (specifically in this case the SQL thread Slave), it doesn't affect if you apply log changes manually as you are doing. The detailed information about replication filtering can be complemented with the replication rule application if you want to understand fully the mechanisms for replication filtering.

A very easy step-by-step tutorial will allow you to setup a standard replica using no other tools than the ones included in the official distribution.

Although you don't want to replicate the table, I recommend you to create the table structure but using BLACKHOLE engine for avoiding some scenarios issues.

| improve this answer | |
  • After adding this filter replicate-ignore-table='dbname.tablename' binlog size is continuously increasing whenever I update or insert the data in the ignore table. – Vignesh Nethaji Jun 1 '19 at 8:03

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.