8

I need to create a database link in MySQL to connect to an Oracle database to use a table present in the Oracle database.

I am not able to find any code or method of creating a database link in MySQL. How could I do this?

Ben
  • 51,770
  • 36
  • 127
  • 149
Ayush Bilala
  • 151
  • 1
  • 2
  • 8

2 Answers2

4

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.html The 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.pm Good luck!

  • 1
    The first link is right now not available (forbidden). I got this from archive: http://web.archive.org/web/20141113060908/http://ftp.nchu.edu.tw/MySQL/tech-resources/articles/dbixmyserver.html – Memochipan Sep 18 '15 at 15:11
  • The article (first link) seems to be available at http://mysql.localhost.net.ar/tech-resources/articles/dbixmyserver.html (I just did a quick search for dbixmyserver.html and skimmed the contents, so I'm not 100% sure whether it's the same one, though) – Frank Schmitt Sep 07 '18 at 06:48
  • You can use this link for the library mentioned above: http://download.nust.na/pub6/mysql/tech-resources/articles/dbixmyserver.html, since the above link is not found. – ASammour Oct 25 '21 at 10:30
0

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

Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
  • People say you can: http://www.dba-oracle.com/t_how_create_database_link.htm (Oracle Database Tips by Donald Burleson | January 17, 2015) – saulius2 Mar 25 '21 at 22:28