Linked servers - SQL2008 to MySql - error: 7303 - Data source - mysql

Problem:
I use SQL Server 2008.
We have here a linked server, linking to a MySql Database.
But since today, when I click "test connection", it shows me this error:
( I can't post images yet):
The test connection to the linked server failed.
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "MANTIS".
OLE DB provider "MSDASQL" for linked server "MANTIS" returned message "[Microsoft][ODBC Driver
Manager] Data source name not found and no default driver specified". (Microsoft SQL Server,
Error: 7303)
What should I do?
It was working yesterday. I thought about "data sources ( ODBC)". Yes, There is no DataSources for MySql ( it doesn't even show me the option to add a mySql odbc when I click ADD), but it was working yesterday !!
I didn't find a reasonable solution from any post.

answer, taken from the question
Restart server + Install MYSQL ODBC DRIVER 51 ( MySql connector )
Start - control panel > Administrative Tools > Data Sources (ODBC) > System DSN > ADD
MySql ODBC 501 Driver

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

SQL Server 2016 Fails Cryptically (Error #7303) on Link to MySQL, But Access 2016 Succeeds with Same System DSN

I am going around in crop circles, trying to set up a linked server (from SQL Server 2016 to MySQL).
Here is the basic procedure that I used: Create a Linked Server to MySQL from SQL Server. Upon clicking OK to create the new linked server, I received the following SSMS 2016 spasm, Error #7303:
The linked server has been created but failed a connection test. Do you want to keep the linked server?
Additional information:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "MYSQL".
OLE DB provider "MSDASQL" for linked server "MYSQL" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". (Microsoft SQL Server, Error: 7303)
I tried variations that included a Provider String and Catalog (same error):
I have tried the latest MySQL ODBC ANSI/Unicode drivers (5.03.07.00), set up via System DSNs in both the 32- and 64-bit versions of the ODBC Data Source Administrator.
Now, I suspect that something screwy is going on with MS SQL Server and/or its OLE-DB Provider (MSDASQL), because:
All tests of the System DSNs within the ODBC Data Source
Administrator are successful.
Crippled Access 2016 is able to link (via the aforementioned Unicode System
DSN) to MySQL just fine, with minimal effort, listing all databases
and tables.
What is the magic that SQL Server 2016 needs to make the linked-server dialog not result in the above error?
Two things --
Product Name should be MSDASQL.
Leave Provider String and Catalog blank (these are typically taken care of by your DSN definition).
That should do it...

Create a Linked Server for a MySQL Database in SQL Server 2005

I'm currently trying something I've never done before - I'm trying to access MySQL data in an SQL Server environment. Where I am, we have two servers (the MySQL and MSSQL servers), and each stores different types of data. Recently I've found a need to write queries that include data for both servers. One of the ways I read to do this is adding a "Linked Server" in SQL Server. But try as I might I cannot seem to get a Linked Server added.
I am working on a Windows 7 system, our SQL Server instance is 2005, and the MySQL version is 5.5.31.
What I've done so far is this:
Downloaded and installed the MySQL ODBC drivers
Created a System DSN using that driver for the MySQL database, called "Production". (I also tested the connection from the Data Sources application and it connects just fine).
Checked for the Provider in SQL Server (MSDASQL) to configure options such as "allow nested queries" and "allow 'LIKE' operator"
right click on Linked Servers in Server Objects in SQL Server > "New Linked Server"
From here, I fill out the linked server info like this:
Checked "Other data source" (not SQL Server)
Chose Provider "Microsoft OLE DB Provider for ODBC Drivers"
Product Name: "Production"
Data Source: (the name of the System DSN) Production
Then in the security tab, I chose the "Connections will be made using this security context" and provided my username and login for the MySQL server.
Then this is where I run into an error every time. I always get the following error message:
The linked server has been created but failed a connection test. Do you want to keep the linked server?
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "FLUX".
OLE DB provider "MSDASQL" for linked server "FLUX" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". (Microsoft SQL Server, Error: 7303)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.5000&EvtSrc=MSSQLServer&EvtID=7303&LinkId=20476
If you click that link for help, by the way, nothing shows up.
I saw other people suggested trying an older MySQL ODBC driver, adding a System Data Source for the 32bit driver as well as the 64bit driver, and restarting my machine (not the DB server) -- none of these fixed my error.
What I do not understand is why my System DSN seems to work and connect fine, but SQL Server cannot see the Data Source. Does anyone see what I'm missing, or what I might be configuring incorrectly?
EDIT
Clarified that I restarted my local machine, but not the DB server since trying to add the Linked Server.
From everything you've said, you probably have a mismatch between bitnesses of SQL Server 2005 components and the installed ODBC Driver for MySQL.
System DSNs are definitely the way to go.
You probably will need to install both the 32-bit and 64-bit ODBC driver, and configure an identical (same name and everything!) System DSN with each.
I would say you may also want/need to install this patch it was useful for getting XP and 2003 to work properly for ODBC type connections for me.
http://www.microsoft.com/downloads/details.aspx?FamilyID=000364db-5e8b-44a8-b9be-ca44d18b059b&displaylang=en
Is your Database server on the same machine on which you have Sql Server Management Studio Installed? If the SQL Server is on a remote machine then you need to install the ODBC driver on remote Machine and create the DSN there as per link
I was having the same issue but the above link solved my problem.

connecting to a MySQL database from MSSQL Management Studio

Somehow I'm having a lot of trouble establishing an ODBC connection to MySQL from within MSSQL Management Studio. I have 64-bit versions of MSSQL and MySQL ODBC connector installed.
The local MySQL database already has a DSN assigned to it. I've used this DSN with Excel in the past and had no problems.
Now, (in SQL Man. Studio) when I access:
'Tasks' -> 'Import Data' -> '.Net Framework Provider for ODBC'
I get a helpful form asking me to enter all the connection details even though I've already registed the DSN in 'Control Panel\Data Sources'.
So, after a brief 'wait, what?", I enter:
Dsn: My_Dsn
Driver: MySQL ODBC 5.2 ANSI Driver
... and get: ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
#
PS.
I've also tried creating a linked MySQL server in MS Studio like so: http://www.sqlservercentral.com/Forums/Topic340912-146-1.aspx
and get:
'contains no columns that can be selected or the current user
does not have permissions on that object.'
In short: no access to MySQL from within MSSQL Studio whatsoever
Thanks in advance!

Advantage to SQL 2008 Linked Server Access Denied Error

I am trying to create a linked server in SQL 2008 to an Advantage v7 database server. I've successfully created the linked server in SQL 2008 using the commands below and the connection tests out fine. Also, the Advantage DB I'm connecting to does not have a data dictionary.
SQL to create the Linked Server
EXEC master.dbo.sp_addlinkedserver
#server = N'ADVANTAGE', #srvproduct=N'Advantage',
#provider=N'Advantage.OLEDB',
#datasrc=N'\\asc1\questtest$\spaulrun'
/* For security reasons the linked server remote logins password is changed with ######## */
EXEC master.dbo.sp_addlinkedsrvlogin
#rmtsrvname=N'ADVANTAGE',
#useself=N'False',
#locallogin=NULL,#rmtuser=NULL,#rmtpassword=NULL
When I run the following query:
select * from
openquery(ADVANTAGE,'select * from members')
I get this error:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Advantage.OLEDB" for linked server "ADVANTAGE" reported an error. Access denied.
Msg 7350, Level 16, State 2, Line 1
Cannot get the column information from OLE DB provider "Advantage.OLEDB" for linked server "ADVANTAGE".
I've verified that this is not an NT File permissions issue. Also, just before the error messages are displayed, I can see all of the column names on the screen for just a second. So I'm getting at least some table information back from Advantage. I just don't know why I'm getting the Access denied message.
Any help is greatly appreciated!
This sounds familiar, but I don't remember the exact error message I got.
Try going to the Advantage OLE DB Provider in the Linked Server setup and right click and choose properties and set "Allow Inprocess".
If I remember correctly, in Management Studio Express i went to
Server Objects -> Linked Servers -> Providers -> Advantage OLE DB Provider (Right Click->Properties or Double Click)
Set "Allow Inprocess"