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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With