Connect TO Sql Server From MySQL - mysql

How can I connect to a SQL Server Database from a MySQL Server? I need to use the MySQL as a proxy DB (querying all the SQL servers and MySQL connected to it).
I need a functionality sort of "linked server" one on SQL server.

You can't - the closest MySQL has is the FEDERATED engine, but it only supports connecting to other MySQL instances, not any other database vendor.
Only SQL Server's Linked Server and Oracle's Database Link technology support connecting to other database vendors (that I'm aware of), so you'd have to use SQL Server as the proxy to MySQL -- not the other way around.

Related

Using workbench to connect to SQL server on management studio

I have been trying to connect to the server on Microsoft SQL Management Studio using Workbench via an IP.
But I cannot seem to connect whatsoever, is workbench even supported with Database engine servers.
I am connecting with the root username, could that be the problem too?
If you are referring to MySQL Workbench and SQL Server, MySQL is a visualization tools for MySQL Server and databases. You cannot access other servers with it. SSMS or SQL Server Management studio is the visualization tool for SQL Server databases. These both databases use almost similar syntax and structure but are totally different entities in terms of Parent Company and access.
In Layman's terms, when you try to enter an IP in Workbench, it tries to find and access a MySQL Server but doesn't find it and hence does not connect. It is not a SSH Client which connects to any server specified.
There is one way to connect SQL Server from MySQL Workbench and that is database miration.
Find More Information Here:
I recommend SQL Server Management Studio for SQL Server Access and visualization.
For connecting to SQL Server using Python, consider PyODBC (preferred) or pymssql as documented here

AWS RDS - MySQL to SQL Server Linked Server - How To / Alternatives

Situation:
I have a MySQL database and SQL Server database, both in AWS RDS. SQL Server is 2016. I need to be able to select data from the MySQL db (in SQL Server). Before moving to RDS, I was able to accomplish this by creating a Linked Server in SQL Server using the MySQL Connector/ODBC.
My understanding is that ODBC driver must be installed/setup on the SQL Server (box), which isn't possible with RDS.
I looked at CLR, but not sure if that will be a viable route either (from reading online) with RDS (?).
Any ideas/experience on how I can select data from the MySQL database in SQL Server when both databases are housed in RDS? The solution doesn't need to be high speed and probably only needs to be used 100 to 200 times.
Only thing I can think of is to create a cache table in SQL, use my application layer to copy the MySQL data to the SQL cache table, and then use that cache table instead of MySQL directly.
Thanks!

Using federated tables to connect MySQL to MSSQL

Can I use federated tables to make the integration of mysql and mssql ?
I tried and it worked mysql to mysql , but if I try to connect to mssql , do not work.
Thank You.
As per MySQL 5.7 Reference Manual - 15.8.1 FEDERATED Storage Engine Overview:
The local server communicates with the remote server using MySQL client C API functions.
... which, naturally, can only connect to mysqld.
MySQL Workbench - Database Migration: Microsoft SQL Server to MySQL gives an overview of options to transfer data between mssql and mysql. They can be summarized as:
Access mysql from mssql through ODBC by adding the former as a "linked server"
Transfer data between the two (either direction) with IDEs (by hand, i.e. one-time)
Transfer data between the two (either direction) with a program that can access both, possibly including data conversion

How to access remote MicroSoft SQL Server database from a stored procedure in MySQL

I need to access a remote Microsoft SQL Server database from a stored procedure in MySQL database.
I googled and found that there is a way to access a remote MySQL using federated tables. But I couldn't find anyway to do access MS SQL Server. My exact requirement is, I need to write a stored procedure which can duplicate all the tables and data from a remote MS SQL server database to a local MYSQL database.
Please help..
In short this cannot be done with MySQL federated engine. However you can setup a link from the remote MSSQL server to a MySQL table using the linked server feature of the MSSQL server.
If you can set this up you can have a scheduled job populate the MySQL tables from the MSSQL server side.
I have done the above setup and it is not to difficult.
I would also investigate some ETL tool to do this as it sounds like a ETL job and not something you want to run via stored procedures.
Good Luck.

Is there a way to connect Oracle from MySQL

Can any one suggest me if there is a way to connect Oracle from MySQL please.
At the moment, no.
MySQL supports FEDERATED storage engine which is similar to Linked Servers / Remote Servers used by another systems, but as for the moment, it only supports remote MySQL servers.
There is a way to connect MySQL from Oracle, though, using Oracle Database Gateway.