0

I want to execute the specific user's modification to the mysql to a mirror database, after research on the search engine, I know I can open turn on the general log config, and select the IDs that produced by the specific user, and map them to binlog and get the sqls we need, but this is a little complex.

can I just record the sql that produced by the specific user?? if yes, things will turn out to be much easier.

  • I think you mean "specific" instead of "special" user? You're basically talking about a **master-slave** setup. See for instance: https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql – KIKO Software Aug 01 '18 at 07:51
  • Thanks, but I don't think master-slave setup can slove my problem – Chijiaodaxie Aug 01 '18 at 08:15
  • You could define a database query class that has the user as a dependency. You could then specify, for each user, to which databases their queries are applied. The problem will always be that there's a change that the databases get out of sync. – KIKO Software Aug 01 '18 at 08:19

0 Answers0