在虚拟化 Windows 2003 x64 服务器上使用 ASP 连接到 MySQL 数据库
我正在尝试使用 MySQL ODBC 5.1 驱动程序连接到 MySQL 5 数据库。在控制面板的 ODBC 设置中,我创建并测试了 ODBC 连接,它工作正常。当我尝试使用 VBScript 代码中的连接时,我收到错误:
ADODB.Connection error '800a0ea9' Provider is not specified and there is no designated default provider.
我使用以下代码:
sConnection = "DSN=mydsn;"
Set objConn = CreateObject("ADODB.Connection")
objConn.Open(sConnection)
DSN-less (DRIVER={MySQL ODBC 5.1 Driver};) 返回相同的错误。
你能帮我让它工作吗?
可能的原因如下: 服务器是 Virtuozzo 虚拟化 Windows 2003 服务器,其中 IIS6 以 64 位运行。我已经安装了 MyODBC 3.51 (x64) 和 MyODBC 5.1(x86 和 x64)。
I'm trying to connect to a MySQL 5 database using the MySQL ODBC 5.1 driver. In the control panel's ODBC settings I created and tested the ODBC connection and it's working fine. When I try to use the connection from VBScript code I get an error though:
ADODB.Connection error '800a0ea9' Provider is not specified and there is no designated default provider.
I use the following code:
sConnection = "DSN=mydsn;"
Set objConn = CreateObject("ADODB.Connection")
objConn.Open(sConnection)
DSN-less (DRIVER={MySQL ODBC 5.1 Driver};) returns the same error.
Can you help me get this working, please?
Some things that might be the cause: The server is a Virtuozzo virtualized Windows 2003 server with IIS6 running as 64bit. I have installed the MyODBC 3.51 (x64) and MyODBC 5.1 (x86 and x64).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我发现它可以作为无 DSN 连接从 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
我放弃了在 64 位模式下运行 IIS - 我按照一些留言板上的建议重新配置 IIS 以在 32 位模式下运行。之后 ODBC 仍然无法工作,但现在我至少可以连接 dsn-less...
I gave up on running IIS in 64bit mode - I followed advice found on some message board to reconfigure IIS to run in 32bit mode. After that ODBC still does not work, but now I can atleast connect dsn-less...
你可以尝试
You might try