"Data source name not found and not specified by default"

I get an error, for example ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified when publishing the website. If I run the website from VisualStudio, it works fine, no problem. I put the connection string web.config in web.config . The connection string is similar to <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 help me solve this problem.

+7
source share
2 answers

Are you publishing on another computer / server? If so, it is possible that the ODBC MySql driver is not installed on the machine you are publishing.

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

EDIT
Another thing to check. See this article and find the text "Master Genius John." It describes a similar error due to the presence of 32-bit and 64-bit versions of the driver. If you are using a 64-bit OS, you may have configured DSN for one version and not another.

+7
source

If the same problem, the problem was that I only had a 64-bit driver for my console application in C #, as soon as I installed the 32-bit driver, in which the program started without problems.

very strange.

+7
source

All Articles