If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Mirror 2 mySQL tables, diff Servers, diff Databases

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-15-07, 14:20
prepress forum prepress forum is offline
Registered User
 
Join Date: Jul 2007
Location: Columbus, Ohio
Posts: 1
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?
Reply With Quote
  #2 (permalink)  
Old 07-16-07, 04:22
aschk aschk is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On