[英]“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. 我收到错误,如
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
在发布网站时ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
。 If I'm running the website from VisualStudio it's working fine, no issue. 如果我从VisualStudio运行网站它工作正常,没问题。 I had put the
connection string
in web.config
file. 我把
connection string
放在web.config
文件中。 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>
连接字符串类似于
<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. 请指导我解决此问题。
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. 有同样的问题,问题是我在C#中只有64位驱动程序用于我的控制台应用程序,一旦我安装了32位驱动程序,程序运行没有问题。
very weird. 很奇怪。
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驱动程序。
MySQL ODBC Driver: MySQL ODBC驱动程序:
http://dev.mysql.com/downloads/connector/odbc/ http://dev.mysql.com/downloads/connector/odbc/
EDIT 编辑
Another thing to check. 另一件要检查的事情。 See this article , and search for the text "Master genius John".
请参阅此文章 ,并搜索“Master genius John”文本。 He describes a similar error due to there being 32bit and 64bit versions of the driver.
他描述了一个类似的错误,因为有32位和64位版本的驱动程序。 If you are running a 64bit OS, it's possible you've configured the DSN for one version and not the other.
如果您运行的是64位操作系统,则可能已将DSN配置为一个版本而不是另一个版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.