I have set up my replication but I want to delete some outdated data from my master tables. Is it possible that say if I have 10 records at master and I delete 5 of them but I want those 10 records to remain on the slave?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
If you're just going to delete this extra data manually on the odd occasion, you can simply turn off the binary logging for the current session. On the MySQL prompt run the following:
Then any query you enter won't be sent to the binary log, and thus won't be sent across to the slaves.
Once you're finished, re-activate binary logging with
Reference: MySQL manual
Solution for PostgreSQL:
We can avoid using rules
- Stop slave daemons
- rule Apply RULE on table
Now, you can notice below that
For MySQL we can create