MySQL ODBC 问题:未找到数据源名称且未指定默认驱动程序
我目前正在尝试运行一个经典的 ASP 应用程序,我已经获得了该应用程序的源代码。我想要在 64 位 Windows 7 开发计算机上进行设置,但在与 MySQL 实例建立基于 ODBC 的数据连接时遇到问题。
我看到错误:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found
and no default driver specified
/includes/<File Name>.asp, line 100
我尝试过的操作:
- 连接无 DSN。
- 该应用程序在具有本地系统权限的 IIS 应用程序池下运行。在进程监视器中可以看到w3wp.exe在NT AUTHORITY/SYSTEM下运行。
- 该应用程序在 IIS 应用程序池下运行,允许运行 32 位应用程序。
- 已尝试使用仅从 http://dev.mysql.com 安装的 Connector/ODBC 5.1.10 64 位版本(此时 C:\Windows\SysWOW64\odbcad32.exe 下没有列出驱动程序,但在 C:\Windows\system32\odbcad32.exe 下)
- 已尝试使用 Connector/ODBC 5.1.10 32 位仅从 http://dev.mysql.com 安装的版本(此时 C:\ Windows\system32\odbcad32.exe 但位于 C:\Windows\SysWOW64\odbcad32.exe 下)
- 已尝试安装 Connector/ODBC 5.1.10 32 位和 64 位版本。
-
已验证的驱动程序名称没有拼写错误。以及此处的其他检查http://support.microsoft.com/kb/306345。< /p>
Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=DBName;User=root;Password=Password;Option=3
附加信息:
我正在进程监视器中进行监视,两个结果是:
PATH NOT FOUND (寻找对于 .asp/web.config 这看起来很奇怪。 缓冲区溢出
两个条目均显示:
用户:NT AUTHORITY\SYSTEM
进程: C:\Windows\SysWOW64\inetsrv\w3wp.exe C:\Windows\SysWOW64\odbcint.dll
我很困惑有人可以就如何在我描述的上下文中运行它提出建议吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
现在解决了问题。在此记录一下,以备其他人使用。
这个问题比最初出现时要简单得多。问题在于应用程序混合使用了命名和未命名数据源(DSN / DSN-Less)。
在我在 Visual Studio 中设置应用程序进行调试之前,我并不清楚是否使用了任何命名连接。这是在 Visual Studio 中调试应用程序的粗略指南(除了我使用基于 HTTP 的网站,而不是文件系统):
http://www.codeproject.com/Articles/28792/Debugging-Classic-ASP-VBScript-in-Visual-Studio-20
创建所需的 DSN 后,出现了一些进一步的异常关于数据库列中的默认值被抛出。这是由于可以在 my.ini 文件中更改的 MySQL 设置造成的。
http://bugs.mysql.com/bug.php?id=14306
C:\Program Files (x86)\MySQL\MySQL Server 5.5\my.ini
Solved the problem now. Recording here in case this of use to others.
The issue was much simpler than it first appeared. The problem was that the application used a mixture of named and unnamed datasources (DSN / DSN-Less).
It was not apparent to me that any named connections were used until I set up the application for debugging in Visual studio. Here is a rough guide to debugging the application in visual studio (Except I used HTTP based website, rather than file system):
http://www.codeproject.com/Articles/28792/Debugging-Classic-ASP-VBScript-in-Visual-Studio-20
Following creating the required DSN, there were some further exceptions being thrown regarding default values in database columns. This was due to a MySQL setting that can be changed in the my.ini file.
http://bugs.mysql.com/bug.php?id=14306
C:\Program Files (x86)\MySQL\MySQL Server 5.5\my.ini
我发现它可以作为
DSN-less
连接从 Windows 到 MySQL。诀窍是消除服务器地址末尾的端口规范。I found this to work from Windows to
MySQL
as aDSN-less
connection. The trick was to ELIMINATE the port spec at the end of the server address.