Linking MySQL server on Sql Server 2008 - mysql

In our application I have to transfer data from between a MySql Server deployed on Linux machine and a SQL Server deployed on a Windows machine, its both the ways.
We plan to do it by creating MySql as a linked server on SQL Server. I have created a DSN pointing to the Linux Server and it shows "Connection Successfull" when I "test" it.
I get the following error when I try to add the same MySql server as a linked server
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "MYSQLDNS".
OLE DB provider "MSDASQL" for linked server "MYSQLDNS" returned message "[MySQL][ODBC 5.1 Driver]Lost connection to MySQL server at 'waiting for initial communication packet', system error: 10060". (Microsoft SQL Server, Error: 7303)
The DSN I am using is a System DSN. I have tried with a User DSN too.
I can connect to the mysql instance using a MySQL Workbench. I can telnet into it too.
Our MySQL is installed on a 64 bit linux machine and the SQL Server is a 32 bit windows machine.

I was getting this error too - 64 bit ODBC version 8 driver from MySQL, using 64 bit Windows and 64 bit SQL Server. For me it was the Connection Timeout property on the linked server in SQL Server

Related

How to connect from MSSQL server running on ubuntu to MySQL?

I'm trying to connect to a MySQL server instance, using a distributed query, with the folling query:
SELECT *
FROM openrowset('SQLNCLI11','server=<>,33333;uid=root;pwd=<>','SELECT * FROM mov.users')
I get the following errors:
OLE DB provider "SQLNCLI11" for linked server "(null)" returned message "Client unable to establish connection due to prelogin failure".
OLE DB provider "SQLNCLI11" for linked server "(null)" returned message "Protocol error in TDS stream".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "SQLNCLI11" for linked server "(null)".
I've tried using SSL on my MSSQL instances and nothing. I've ran the execute command for the sp_configure to enable 'ad hoc distributed queries', and nothing. I've tried to create a linked server but it doesn't seem to be a mssql on linux compatible feature.
How can I cestablish a direct connection between a MSSQL running on linux to a MySQL server?
On Linux, SQL Server does not support Linked Servers to data sources other than SQL Server. See unsupported features

Failure to connect to MySQL server from SQL Server Migration Assistant

I have SQL Server 2017 Developer installed. I want to use the SQL Server Migration Assistant for MySQL to migrate a MySQL database into SQL Server. But I can't get the migration assistant to connect to the MySQL server. First of all, using MySQL Workbench I can connect to the server with no problem through this dialog box;
MySQL Workbench connection dialog box
Using the same service, (or server) name, port and user entered into the migration assistant dialog box for connecting to the MySQL server;
SQL Server Migration Assistant connection to MySQL Server dialog box
I get an error message saying,
Cconnection to MySQL failed. ERROR [HY000] [MySQL][ODBC 5.2(w) Driver]Unknown MySQL server host 'Mysql#127.0.0.1' (0)
I've tried selecting both the ANSI and unicode ODBC drivers, version 5.2 and 5.3. Nothing seems to work.
You need to remove "Mysql#" from the connection string. This isn't a necessary part of the hostname when connecting through SSMA.

SQL Server Login works with DSN for ODBC driver 11 for SQL Server but unable to connect through connection string (Classic ASP Application)

We have a Classic ASP application hosted on server Win 2008 R2, Database - SQL server 2008 R2. The application was working fine until we disabled TLS 1.0 and enabled TLS 1.2 in app server. TLS 1.2 is enabled on Database server. We have installed SSMS on app server and are able to connect to DB. Created a system DSN and tested using ODBC drivers which is only successful when tried "ODBC driver 11 for SQL Server" driver. Performed UDL test in app server and the test connection failed while using both DSN and connection string with errors "Invalid Connection String Attribute" and "Data source name not found and no default driver specified" respectively. Instead of OLEDB we have tried SQLNCLI10 which also didn't work.
Tried all the drivers and the respective connection-strings, though able to establish connection using "ODBC driver 11 for SQL Server". Hence also tried the connection strings
SQL Server Native Client
Driver={SQL Server Native Client 11.0};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
SQL Server for ODBC
DRIVER={ODBC Driver 11 for SQL Server};SERVER=test;DATABASE=test;UID=user;PWD=password
DSN
DSN=myDsn;Uid=myUsername;Pwd=;
But unable to establish connection to database. Please suggest.
This works for my SQL Server 2008 R2 classic ASP application.
Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

MS SQL Server 2008 connection issue

I have a Linux server and a database server (MSSQL 2008) at another location. I use the MySQL ODBC connector to connect to the MS server, but the connection fails every time. I also changed the bind address of my MySQL server to my IP address.

Do I need to install SQL Express if SQL Server is already installed?

I have a server that has SQL Server 2008 R2 installed but my application uses SQL Express 2008 R2 - do I need to install SQL Express as well? The error Im currently getting is:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified)
You can create your database the SQL Server and connect with the correct connection string. You can not attach your Database files like in SQL Server express though.
There is no need to install SQL Server Express.
A common connection string to connect to SQL Server is:
Data Source=yourServer;Initial Catalog=yourDatabase;Integrated Security=SSPI;
Replace yourServer with the servername (in the form of Server\instance) and yourDatabase with the name of the database you wish to connect to.
The following connection string for SQL Server Express does not work on a standard SQL Server:
Server=yourServer;AttachDbFilename=c:\data\yourDatabase.mdf;Database=yourDatabase; Trusted_Connection=Yes;