0

I want to replicate all update statement from Master as a Insert at Slave end.

Is it possible like in SQL Server? If so, how?

I want to do it because, if any record on Master is updating and if same record is not present at Slave end, then instead of Replication tends to fail, it should insert that record at Slave end.

All insert on Master will act as Insert only at Slave end.

2
  • Use replace into instead of insert and if the record is already present, it would first delete the old one and would insert the new one and if it is not present it would simply insert. This way even if the master have a record which slave doesn't, it would be update at master and insert on slave. Hope it helps Jul 29, 2015 at 3:05
  • how can i implement this ? Sep 4, 2015 at 10:46

1 Answer 1

0

How about using INSERT ... ON DUPLICATE KEY UPDATE or REPLACE INTO on master itself?

2
  • i understand this,but this is for updation (Insert on..) when duplicate primary key present. I want to replicate update happening on master as Insert at slave. Jul 28, 2015 at 11:55
  • I doubt (but will be interested to know) if that's possible in MySQL! Mostly not.
    – mysql_user
    Jul 28, 2015 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.