Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2007
    Location
    Columbus, Ohio
    Posts
    1

    Unanswered: Mirror 2 mySQL tables, diff Servers, diff Databases

    Hello,

    I have 2 tables on 2 different mySQL databases. I am looking for a way to Mirror each one to each other. If an entry gets made in one, it gets mirrored to the other. i also need this to be something easy, safe, secure way.

    What is best way to accomplish this?

  2. #2
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    You can use MySQL replication to achieve this. However beware of Primary auto incrementing keys, and other keys which may conflict.
    e.g. Simultaneous inserts
    entry 1 -> db 1 , with primary auto key = 1
    entry 1 -> db 2 , with primary auto key = 1
    ==> replicate db 1 to db 2 = ERROR!
    ==> replicate db 2 to db 1 = ERROR!

    To avoid this you need to need to set the auto_incrementing key to jump numbers. i.e. entries in db1 start at 1 and have an increment of 2, and entries in db2 start at 2 and have an increment of 2.
    Therefore the above scenario
    entry 1 -> db 2 , with primary auto key = 2


    I'm only talking about theory here and have never applied the above to real life DB application.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •