0

I have one the same server (Linux) two databases: db1 and db2 and I want to replicate db1.table1 to db2.table1

I added the following lines to my.cnf and restarted mysql service

replicate-do-table = db2.table
replicate-rewrite-db = database1->database2

but it's not working. Are those commands correct ? Do I need to set permissions on both databases ?

mysql version: 5.5.25a

Thanks in advance

asked Sep 5, 2014 at 15:02
1
  • Depending on why you want to do this, there may be (different) way... what issue are you trying to solve? Commented Sep 5, 2014 at 23:14

1 Answer 1

1

MySQL Replication was designed to replicate data between two MySQL Instances, not two MySQL Databases within the same instance.

What you need to do is write triggers in db1.table1 to write the same changes to db2.table1.

See my old post How to set up triggers in MySQL for copying a field for some ideas.

answered Sep 5, 2014 at 15:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.