Solved

Perplexed! Trying to link a MySQL server to MS SQL 2005

Posted on 2008-10-27
4
372 Views
Last Modified: 2010-04-21
I think I have read about every post on EE (and the Internet) regarding this subject. I must be dense....
I have a SQL 2005 server that I want to link a MySQL database to that resides on a different server. I then want to be able to run queries against the linked MySQL database from the SQL 2005 server.

I have added the MySQL sever to the Linked Servers by right clicking and adding a new server.
Linked server: Ciscoworks
Other data source
Provider: Microsoft OLE DB Provider for ODBC Drivers
Product name: Ciscoworks
Data source: Cisco
Provider string: Driver={MySQL ODBC 3.51 driver};SERVER=myServerIPAddress; Option=3; DataBase=TrueControl; User=MyUsername;Password = mypassword;
Location (left blank)
Catalog (left blank)

When I run sp_testlinkedserver ciscoworks I get the error:

OLE DB provider "MSDASQL" for linked server "Ciscoworks" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
Msg 7303, Level 16, State 1, Procedure sp_testlinkedserver, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "Ciscoworks".
-------
I have tried a LOT of different options the past 3 hours so I might be over complicating things.

Suggestions?
0
Comment
Question by:edrz01
  • 2
  • 2
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22815396
empty the data source property. the connection string holds it all.
now, I assume (but want to verify with your) that the mysql odbc driver IS installed on the sql server box, and that a test connection in the odbc administration tool is working.

side question: is your sql server box 32 bit or 64 bit?
0
 

Author Comment

by:edrz01
ID: 22822128
Thanks Angellll (and congrats!)

The server is 32 bit.
I logged into the server that has the MySQL database and looked in Data Sources (ODBC). Under System DSN I see one I created called Ciscoworks and the driver is MySQL ODBC 3.51 Driver. When I click on configure I see all of the settings I previously put into it. I can click on Test and it works.

On my SQL 2005 server I checked and you were right - it wasn't installed (thought I did it already). I added it and worked through the adding account with the @servername issue. I was finally able to get the MySQL ODBC connector on my SQL2005 server to connect to the MySQL server.

So now on my SQL2005 server I have a System data source called Ciscoworks....
When I try to execute a query from SQL Management Studio like

SELECT * FROM [ServerNameGoesHere]...[truecontrol.rn_device]

I get this message:

OLE DB provider "MSDASQL" for linked server "ServerNameGoesHere" returned message "[MySQL][ODBC 3.51 Driver]Access denied for user: 'CM@F.Q.D.N' (Using password: YES)".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "ServerNameGoesHere".

Any other ideas? Getting oh, so close.....
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22822206
in the properties of the linked server, select the security tab,
choose the option "be made using this security context",
and enter the username/password into the remote login/with password fields (the mysql login/passwords)

ensure that on the mysql side, that login is allowed to connect remotely.
0
 

Author Closing Comment

by:edrz01
ID: 31597332
Angel, you are a genius! That worked, once I granted permission to the user it worked.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now