Solved

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

Posted on 2008-10-27
4
371 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

17 Experts available now in Live!

Get 1:1 Help Now