Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL equivalent of PostgreSQL's dblink module?

PostgreSQL's dblink module allows for SQL statements to be written that execute other SQL statements against a remote PostgreSQL database.

Is there an equivalent to PostgreSQL's dblink for MySQL?

like image 845
user145420 Avatar asked Nov 22 '25 01:11

user145420


2 Answers

No. This is not possible with MySQL. The closest you can come is to use replication to replicate the tables you need from the "remote" database down to the slave you are querying on. See the documentation for more details.

like image 162
hobodave Avatar answered Nov 24 '25 00:11

hobodave


Not exactly.

There is, however the FEDERATED storage engine (available since 5.0.3), which can be used in certain situations to emulate this behaviour. It is, (put very simply) a VIEW for a remote table.

There is an in-depth explanation, along with examples on its MySQL manual page(s).

like image 42
jason Avatar answered Nov 24 '25 00:11

jason



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!