简体   繁体   English

SQL Server 2016未能成功链接到MySQL,但失败(错误#7303),但是使用相同系统DSN的Access 2016成功

[英]SQL Server 2016 Fails Cryptically (Error #7303) on Link to MySQL, But Access 2016 Succeeds with Same System DSN

I am going around in crop circles, trying to set up a linked server (from SQL Server 2016 to MySQL). 我在庄稼圈里转转,试图建立一个链接服务器(从SQL Server 2016到MySQL)。

Here is the basic procedure that I used: Create a Linked Server to MySQL from SQL Server . 这是我使用的基本过程: 从SQL Server创建到MySQL的链接服务器 Upon clicking OK to create the new linked server, I received the following SSMS 2016 spasm, Error #7303: 单击确定以创建新的链接服务器后,我收到以下SSMS 2016痉挛,错误#7303:

The linked server has been created but failed a connection test. Do you want to keep the linked server?

Additional information:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "MYSQL".
OLE DB provider "MSDASQL" for linked server "MYSQL" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". (Microsoft SQL Server, Error: 7303)

错误7303:

I tried variations that included a Provider String and Catalog (same error): 我尝试了包含提供程序字符串和目录(相同的错误)的变体:

链接服务器对话框:

I have tried the latest MySQL ODBC ANSI/Unicode drivers (5.03.07.00), set up via System DSNs in both the 32- and 64-bit versions of the ODBC Data Source Administrator. 我已经尝试了通过32位和64位版本的ODBC数据源管理器通过系统DSN设置的最新的MySQL ODBC ANSI / Unicode驱动程序(5.03.07.00)。

Now, I suspect that something screwy is going on with MS SQL Server and/or its OLE-DB Provider (MSDASQL), because: 现在,我怀疑MS SQL Server和/或其OLE-DB Provider(MSDASQL)正在发生麻烦,原因是:

  1. All tests of the System DSNs within the ODBC Data Source Administrator are successful. ODBC数据源管理器中的系统DSN的所有测试均成功。

  2. Crippled Access 2016 is able to link (via the aforementioned Unicode System DSN) to MySQL just fine, with minimal effort, listing all databases and tables. Crippled Access 2016可以轻松地(通过上述Unicode系统DSN)链接到MySQL,列出所有数据库和表。

What is the magic that SQL Server 2016 needs to make the linked-server dialog not result in the above error? SQL Server 2016使链接服务器对话框不导致上述错误的神奇之处是什么?

Two things -- 两件事情 -

  1. Product Name should be MSDASQL . 产品名称应为MSDASQL

  2. Leave Provider String and Catalog blank (these are typically taken care of by your DSN definition). 将“ 提供程序字符串”和“ 目录”保留为空白(通常由您的DSN定义处理)。

That should do it... 那应该做...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM