It is not allowing to use two database server connections in single query..
Connecting two mysql tables from different databases
Collapse
X
-
JOIN between 2 different servers with MySQL
But be careful! The performance is not good. If you really need to do that you must prepare your servers rightly. Read the docs and share it with the infrastructure staff and network.
Cheers!Comment
-
Well - nuff said by all the others but how about adding real mysql replication if all you wanna do is to sync records with different timestamps from server 1 to server 2?
Or - if this won't be possible in your infrastructure, go the SLOW way withoud federated tables and do something like this:
1) find a way to store a "last run" timestamp
2) select all records from server 1 where the timestamp is > the last run timestamp
3) in the while( ... ) loop execute your replace into ... to server 2 sql with the data read from server 1.
Depending on the amount of records and the frequency of synch ... but i would always prefer the build in replication (master/slave)Comment
Comment