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:
$ 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/
$ 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 ?