如何在 MySQL 中创建数据库链接连接到 Oracle?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19092636/
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 a database link in MySQL to connect to Oracle?
提问by Ayush Bilala
I need to create a database link in MySQL to connect to an Oracle database to use a table present in the Oracle database.
我需要在 MySQL 中创建一个数据库链接以连接到 Oracle 数据库以使用 Oracle 数据库中存在的表。
I am not able to find any code or method of creating a database link in MySQL. How could I do this?
我找不到在 MySQL 中创建数据库链接的任何代码或方法。我怎么能这样做?
回答by nosotros.pensamos
You can access the Oracle (or other DBMS) information directly from within MySQL using the MySQL Federated tables via the Perl DBIx::MyServer proxy. This method has been around since about 2007: a good step-by-step write-up of the set-up and usage is available here: http://ftp.nchu.edu.tw/MySQL/tech-resources/articles/dbixmyserver.htmlThe write-up demonstrates not only the usage of 'select' statements from directly within MySQL to postgres and sqlite native tables, but also inserts back into those tables, using queries executed directly from within the MySQL environment. The Perl module is available here: http://search.cpan.org/~philips/DBIx-MyServer-0.42/lib/DBIx/MyServer.pmGood luck!
您可以通过 Perl DBIx::MyServer 代理使用 MySQL 联合表直接从 MySQL 中访问 Oracle(或其他 DBMS)信息。这种方法自 2007 年左右就出现了:此处提供了设置和使用的详细分步说明:http: //ftp.nchu.edu.tw/MySQL/tech-resources/articles/ dbixmyserver.html 这篇文章不仅演示了直接在 MySQL 中使用“select”语句到 postgres 和 sqlite 原生表,而且还使用直接从 MySQL 环境中执行的查询插入回这些表。Perl 模块在此处可用:http: //search.cpan.org/~philips/DBIx-MyServer-0.42/lib/DBIx/MyServer.pm祝你好运!
回答by Mike Lischke
The Oracle RDBMS and the MySQL RDBMS are two totally different servers. Even though both store data and implement the SQL language to managed that they have nothing in common. That also means you cannot reference an Oracle server from a MySQL server and vice versa. You even cannot address a different MySQL server from another one. All work is done always against a single server you connect to (either from a visual client like MySQL Workbench or the command line client).
Oracle RDBMS 和 MySQL RDBMS 是两个完全不同的服务器。尽管两者都存储数据并实现 SQL 语言进行管理,但它们没有任何共同之处。这也意味着您不能从 MySQL 服务器引用 Oracle 服务器,反之亦然。您甚至无法从另一个 MySQL 服务器寻址不同的 MySQL 服务器。所有工作始终针对您连接的单个服务器完成(来自 MySQL Workbench 等可视客户端或命令行客户端)。