Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 985
Able Alias Avatar asked Jun 27 '11 12:06

Able Alias


2 Answers

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.

like image 84
rsbarro Avatar answered Oct 07 '22 15:10

rsbarro


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.

like image 7
Angel Avatar answered Oct 07 '22 14:10

Angel