MySQL equivalent of PostgreSQL's dblink module

2019-02-24 19:46发布

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?

3条回答
聊天终结者
2楼-- · 2019-02-24 20:12

You might want to look into MySQL Proxy. This doesn't match the architecture of dblink, but you can probably solve a similar set of problems that you would use dblink to solve.

查看更多
爷、活的狠高调
3楼-- · 2019-02-24 20:14

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.

查看更多
爷、活的狠高调
4楼-- · 2019-02-24 20:21

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).

查看更多
登录 后发表回答