davidz Posted October 30, 2007 Share Posted October 30, 2007 I'm using PHP5+Mysql 4.0+Apache 2.0. I need to join tables from two different Mysql servers. I've looked everywhere and can't find a for sure yes or no if this is possible. So my question is: Is it possible to join tables using php from two different servers? If yes, how? Thanks! David Link to comment https://forums.phpfreaks.com/topic/75379-joining-tables-from-two-different-servers/ Share on other sites More sharing options...
fenway Posted October 30, 2007 Share Posted October 30, 2007 In theory, it's possible across 2 databases on the same machine if the credentials are the same, but otherwise, you have to "convince" the DB that the table exists "locally". Why not use a FEDERATED table? Link to comment https://forums.phpfreaks.com/topic/75379-joining-tables-from-two-different-servers/#findComment-381299 Share on other sites More sharing options...
davidz Posted October 30, 2007 Author Share Posted October 30, 2007 The two databases are on completely different servers, so doing a dbname.tblname.field in the SELECT will not work. Now correct me if I'm wrong, the FEDERATED tables are basically just aliases to a table on another server? Thanks, David Link to comment https://forums.phpfreaks.com/topic/75379-joining-tables-from-two-different-servers/#findComment-381313 Share on other sites More sharing options...
fenway Posted October 30, 2007 Share Posted October 30, 2007 Now correct me if I'm wrong, the FEDERATED tables are basically just aliases to a table on another server? Yes, that's correct... but you really should be using 4.1 or higher. Link to comment https://forums.phpfreaks.com/topic/75379-joining-tables-from-two-different-servers/#findComment-381324 Share on other sites More sharing options...
davidz Posted October 30, 2007 Author Share Posted October 30, 2007 Now correct me if I'm wrong, the FEDERATED tables are basically just aliases to a table on another server? Yes, that's correct... but you really should be using 4.1 or higher. Yeah, it's actually on our todo list to upgrade both servers to 5. Thanks for the info! David Link to comment https://forums.phpfreaks.com/topic/75379-joining-tables-from-two-different-servers/#findComment-381328 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.