LinkedServer help

Posted on 2007-10-15
Last Modified: 2012-05-05
Hello there,

i am trying to link my MySQL db to work with SSRS.Somewhere i read that i need to use linked server.i managed to run the first two query,but when i run the third query i get an error mentioned below.please help me solve this. the mysql db is not on my computer.
also i dont know what those query do.can you please explain what those query do.please help.


EXEC sp_addlinkedserver 'mysqlDB', 'MySQL', 'MSDASQL', Null, Null, 'Driver={MySQL ODBC 3.51 Driver};DB=[Customer];SERVER=[];uid=[report];pwd=[services]'

EXEC sp_addlinkedsrvlogin
@rmtsrvname = 'mysqlDB',
@useself = 'TRUE',
@locallogin = NULL

EXEC sp_tables_ex 'mysqlDB'

OLE DB provider "MSDASQL" for linked server "mysqlDB" returned message "[MySQL][ODBC 3.51 Driver]Unknown MySQL server host '[]' (11004)".
Msg 7303, Level 16, State 1, Procedure sp_tables_ex, Line 41
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "mysqlDB".
Question by:zolf
    LVL 142

    Accepted Solution

    this should work better:

    EXEC sp_addlinkedserver 'mysqlDB', 'MySQL', 'MSDASQL', Null, Null, 'Driver={MySQL ODBC 3.51 Driver};DB=[Customer];SERVER='

    EXEC sp_addlinkedsrvlogin
    @rmtsrvname = 'mysqlDB',
    @useself = 'FALSE',
    @locallogin = NULL,
    @rmtuser ='report',
    @rmtpassword = 'services'

    Author Comment


    Thanks mate

    Author Comment


    Can you please explain what does those query do.
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    actually, I removed the [] around the ip address (which was simply wrong).
    next, I "moved" the login settings from the linked server to the linked server login, where it should be.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    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.
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    734 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

    22 Experts available now in Live!

    Get 1:1 Help Now