Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Triggers on Slave database (in the context of replication) for auditing purpose in MySQL

$
0
0

I have a requirement for auditing in MySQL database. It means I am interested in what data is changed in my database and when. For fulfilling this requirement I am thinking about the triggers. I am also using row based replication which ensures that data from master database is copied on slave machine. Since triggers might reduce the performance and it can introduce additional issues like row locking, I would like to avoid it on master database. Instead I would like to define triggers only on slave machine. Since data on slave will be identical with master, my requirement of auditing will be fulfilled also I can avoid performance and locking issues on master. Following are my environment details

Environment details

  1. MySQL version 5.6 on windows
  2. Master and Slave database with row based replication

So my questions are

  1. Is it possible in MySQL to define the triggers only on slave?
  2. Is this a correct approach?
  3. Will it create any serious issue?

Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>