Solved

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

Posted on 2008-10-27
4
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 143

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 143

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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