如何创建链接服务器 MySQL
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5370970/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to create linked server MySQL
提问by Tioma
Is it possible create/configure MySQL for functionality like SQL Server's Linked Server?
是否可以为 SQL Server 的链接服务器等功能创建/配置 MySQL?
If yes, would you please tell me how? I'm using MySQL 5.5.
如果是的话,你能告诉我怎么做吗?我正在使用 MySQL 5.5。
回答by OMG Ponies
MySQL's FEDERATED engineprovides functionality similar to SQL Server's Linked Server (and Oracle's dblink) functionality, but doesn't support connecting to vendors other than MySQL. It's not clear from the question if you need the functionality to connect to vendors other than MySQL.
MySQL 的FEDERATED 引擎提供类似于 SQL Server 的链接服务器(和 Oracle 的 dblink)功能的功能,但不支持连接到除 MySQL 之外的供应商。从问题中不清楚您是否需要连接到 MySQL 以外的供应商的功能。
You might want to look into MySQL Proxy. This doesn't match the architecture of Linked Servers/dblink, but you can probably solve a similar set of problems that you would use Linked Servers/dblink to solve.
您可能想查看MySQL Proxy。这与 Linked Servers/dblink 的体系结构不匹配,但是您可能可以解决一组类似的问题,您将使用 Linked Servers/dblink 来解决这些问题。
回答by TheAce
I am the developer of the MySQL Data Controller. Unfortunately, since we had lack of requests we have stopped development on it. The plugin was 100% functional with MySQL connecting to Oracle, MSSQL or MySQL.
我是 MySQL 数据控制器的开发人员。不幸的是,由于我们缺乏请求,我们停止了对它的开发。该插件在 MySQL 连接到 Oracle、MSSQL 或 MySQL 时 100% 正常运行。
Base on some requests, we had added back a blog and video about it :
根据一些要求,我们重新添加了一个关于它的博客和视频:
http://www.acentera.com/mysql-datacontroller/
http://www.acentera.com/mysql-datacontroller/
Regards, Francis L.
问候,弗朗西斯·L。
回答by Clark Vera
Unfortunately you cannot link an entire MySQL database to another MySQL database like you can with MS SQL. However, you can link individual tables. A federated table is a local table you create that points to a table on another server.
不幸的是,您无法像使用 MS SQL 那样将整个 MySQL 数据库链接到另一个 MySQL 数据库。但是,您可以链接单个表。联合表是您创建的指向另一台服务器上的表的本地表。
You can run queries and stored procedures just like any other table. The two tables must have the same structure, except the Federated table uses a different database engine: Federated. If you make ANY changes to the structure of the remote table, you should re-create the local federated table.
您可以像运行任何其他表一样运行查询和存储过程。这两个表必须具有相同的结构,除了 Federated 表使用不同的数据库引擎:Federated。如果对远程表的结构进行了任何更改,则应重新创建本地联合表。
The process is actually quite easy, here is an example: https://docs.oracle.com/cd/E17952_01/mysql-5.0-en/federated-use.html
这个过程其实很简单,下面是一个例子:https: //docs.oracle.com/cd/E17952_01/mysql-5.0-en/federated-use.html
In my experience, the time needed to create and implement this process is minimal, even when compared to linked servers. It should take you less than 30 minutes to get your first federated table working, after that its a 5 min process. Last item, when naming your federated table, I give it the same name as the remote table with a "federated_" in front, like federated_customer.
根据我的经验,即使与链接服务器相比,创建和实施此过程所需的时间也是最少的。让您的第一个联合表工作应该需要不到 30 分钟,然后是 5 分钟的过程。最后一项,在命名联合表时,我将其命名为与前面带有“federated_”的远程表相同的名称,例如 federated_customer。
Also, store your federated table definitions as separate stored procedures so you can reuse them anytime you need to create the federated table again, AND so that other developers can see how you generated the federated table.
此外,将联合表定义存储为单独的存储过程,以便您可以在需要再次创建联合表的任何时候重用它们,并且其他开发人员可以看到您如何生成联合表。
回答by Bruce Patin
The MySQL Data Controller is a follow-on to the federated engine that allows connection to different database types, such as Microsoft SQL Server or Oracle. I am not sure how development is going, yet.
MySQL 数据控制器是联邦引擎的后续,它允许连接到不同的数据库类型,例如 Microsoft SQL Server 或 Oracle。我还不确定开发进展如何。
See: http://en.wikipedia.org/wiki/MySQL_DataController
请参阅:http: //en.wikipedia.org/wiki/MySQL_DataController