List:General Discussion« Previous MessageNext Message »
From:Steve Edberg Date:December 7 2009 6:41pm
Subject:Re: Mysql version of database link?
View as plain text  
At 12:16 PM -0600 12/7/09, Bryan Cantwell wrote:
>Does anyone have a suggestion on how a database link (like in 
>Oracle) could be established between two Mysql databases on 
>different servers?
>It would be awesome if I could write sql that will query both 
>databases in one query...

You are probably looking for federated tables:

And just for completeness, one can query multiple databases on the 
same server using the database.table.column syntax, eg:

	select db1.table1.column1 as a, db2.table2.column2 as b;

One could also replicate a remote database to your server, and use 
the db.table.column notation:

I'm guessing the latter two options are not what you are asking for, 
but I include for completeness.

DISCLAIMER: I haven't used federated tables yet...

	- steve

| Steve Edberg                                  edberg@stripped |
| Programming/Database/SysAdmin   |
Mysql version of database link?Bryan Cantwell7 Dec
  • Re: Mysql version of database link?Steve Edberg7 Dec
  • Re: Mysql version of database link?Johan De Meersman7 Dec