MySQL ODBC 问题:未找到数据源名称且未指定默认驱动程序

发布于 2025-01-07 22:05:13 字数 1520 浏览 4 评论 0 原文

我目前正在尝试运行一个经典的 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

我很困惑有人可以就如何在我描述的上下文中运行它提出建议吗?

I'm currently trying to run a classic ASP application which I've been given source code for. I want to set up on my 64bit Windows 7 dev machine and am having trouble with an ODBC based data connection to a MySQL instance.

I'm seeing the error:

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

What I've tried:

  • The connection is DSN-less.
  • The application is running under IIS app pool with local system permissions. w3wp.exe can be seen running under NT AUTHORITY/SYSTEM in process monitor.
  • The application is running under IIS app pool with 32 bit applications allowed to run.
  • Have tried with Connector/ODBC 5.1.10 64 bit version only installed from http://dev.mysql.com (At this point no driver was listed under C:\Windows\SysWOW64\odbcad32.exe but was under C:\Windows\system32\odbcad32.exe)
  • Have tried with Connector/ODBC 5.1.10 32 bit version only installed from http://dev.mysql.com (At this point no driver was listed under C:\Windows\system32\odbcad32.exe but was under C:\Windows\SysWOW64\odbcad32.exe)
  • Have tried with Connector/ODBC 5.1.10 32 bit and 64 bit versions installed.
  • Verified driver name is not misspelled. Along with other checks from here http://support.microsoft.com/kb/306345.

    Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=DBName;User=root;Password=Password;Option=3

Additional Information:

I'm monitoring in process monitor, and the two results are:

PATH NOT FOUND (Looking for .asp/web.config which seems odd.
BUFFER OVERFLOW

Both entries show:

User: NT AUTHORITY\SYSTEM

Process:
C:\Windows\SysWOW64\inetsrv\w3wp.exe
C:\Windows\SysWOW64\odbcint.dll

I'm stumped can any one make a suggestion on how I get this running in the context I have described?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

再浓的妆也掩不了殇 2025-01-14 22:05:13

现在解决了问题。在此记录一下,以备其他人使用。

这个问题比最初出现时要简单得多。问题在于应用程序混合使用了命名和未命名数据源(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

# Set the SQL mode to strict
# sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
sql-mode=""

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

# Set the SQL mode to strict
# sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
sql-mode=""
千纸鹤带着心事 2025-01-14 22:05:13

我发现它可以作为 DSN-less 连接从 Windows 到 MySQL。诀窍是消除服务器地址末尾的端口规范。

"DRIVER={MySQL ODBC 5.3 UNICODE Driver}; Server=**;Database=**;User=**;Password=**; OPTION=3"

注意:服务器字符串是服务器的互联网地址,但没有端口
指定 - 即末尾没有“:3306”

I found this to work from Windows to MySQL as a DSN-less connection. The trick was to ELIMINATE the port spec at the end of the server address.

"DRIVER={MySQL ODBC 5.3 UNICODE Driver}; Server=**;Database=**;User=**;Password=**; OPTION=3"

Note: Server string is the internet address of the server, BUT NO PORT
SPECIFIED - ie, NO ":3306" on the end

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文