"Data source name not found and no default driver specified" error

15,633

Solution 1

Are you publishing to a different computer/server? If so, it could be possible that the MySql ODBC Driver is not installed on the machine you are publishing to.

MySQL ODBC Driver:
http://dev.mysql.com/downloads/connector/odbc/

EDIT
Another thing to check. See this article, and search for the text "Master genius John". He describes a similar error due to there being 32bit and 64bit versions of the driver. If you are running a 64bit OS, it's possible you've configured the DSN for one version and not the other.

Solution 2

Had this same issue, the problem was I only had the 64 bit driver for my console application in C#, once I installed the 32 bit driver the program ran with no issues.

very weird.

Share:
15,633
Able Alias
Author by

Able Alias

Updated on June 25, 2022

Comments

  • Able Alias
    Able Alias almost 2 years

    I'm getting an error like ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified when publish the website. If I'm running the website from VisualStudio it's working fine, no issue. I had put the connection string in web.config file. The connection string is like <appSettings> <add key="ConnectionStr" value="DRIVER={MySQL ODBC 5.1 Driver};SERVER=10.7.26.75;PORT=3306;DATABASE=XXXXXX;UID=XXXXX;PASSWORD=root123"/> </appSettings>

    Please guide me to resolve this issue.

  • Able Alias
    Able Alias almost 13 years
    No, I'm trying to publish from the same machine.That machine have already installed the ODBC Connector
  • rsbarro
    rsbarro almost 13 years
    Just to be clear, are publishing from your dev machine to another location on your dev machine?
  • rsbarro
    rsbarro almost 13 years
    Odd. Here's another question similar to yours with no answer: stackoverflow.com/questions/4831176/…
  • rsbarro
    rsbarro almost 13 years
  • Able Alias
    Able Alias almost 13 years
    yes, it is resolved. i have installed the 64bit version of ODBC connector, because my machine is a 64bit machine. Actually previously i have installed 32 bit ODBC connector. Thanks for your interest.
  • rsbarro
    rsbarro almost 13 years
    Glad you got it figured out. Of course if you like this answer you could always accept it. =]