简体   繁体   English

使用OBDC驱动程序将MySQL链接到MS SQL Server(错误7303)

[英]Linking MySQL to MS SQL Server using OBDC Drivers (Error 7303)

I am trying to make a link between MySQL and MSSQL databases using ODBC Drivers. 我正在尝试使用ODBC驱动程序在MySQL和MSSQL数据库之间建立链接。 The reason is that our website is built using PHP and MySQL and we need to manage the database from SQL Server Manag. 原因是我们的网站是使用PHP和MySQL构建的,我们需要通过SQL Server Manag管理数据库。 Studio. 工作室。

I have already linked MySQL to MS ACCESS, so MySQL ODBC drivers are fully working. 我已经将MySQL链接到MS ACCESS,因此MySQL ODBC驱动程序可以正常工作。

When I try to link them from MICROSOFT SQL SERVER MANAGEMENT STUDIO > SERVER OBJECTS > LINKED SERVERS > NEW LINKED SERVER... 当我尝试从MICROSOFT SQL服务器管理工​​作室>服务器对象>链接的服务器>新的链接的服务器...链接它们时...

With this configuration: 使用此配置:

配置的第一个选项卡

配置的第二个选项卡

配置的第三个选项卡

I get this error: 我收到此错误:

错误7303


I have tried with all these versions of MySQL OBDC Drivers: 我已经尝试过所有这些版本的MySQL OBDC Drivers:

  • ODBC 5.3 Unicode (32-bit) - This one is the one working with MS ACCESS ODBC 5.3 Unicode(32位)-这是使用MS ACCESS的一种
  • ODBC 5.3 ANSI (32-bit) ODBC 5.3 ANSI(32位)
  • ODBC 5.3 Unicode (64-bit) ODBC 5.3 Unicode(64位)
  • ODBC 5.3 ANSI (64-bit) ODBC 5.3 ANSI(64位)
  • ODBC 8.0 Unicode (64-bit) ODBC 8.0 Unicode(64位)
  • ODBC 8.0 ANSI (64-bit) ODBC 8.0 ANSI(64位)

ODBC系统配置


For the NEW LINKED SERVER: 对于新的链接服务器:

  1. I have tried writing this in "Provider string": 我尝试将其写在“提供程序字符串”中:

    • Driver={MySQL ODBC 5.3 ANSI Driver}; 驱动程序= {MySQL ODBC 5.3 ANSI驱动程序};
      DATABASE=myDB;OPTION=134217728;PWD=myPASS;UID=myUSER;SERVER=mySERVER DATABASE = myDB; OPTION = 134217728; PWD = myPASS; UID = myUSER; SERVER = mySERVER

    • ODBC:DSN=KARALIGROUP32::Table=myTABLE ODBC:DSN = KARALIGROUP32 :: Table = myTABLE

I have also tried writing myTABLE in "Catalog". 我也尝试过在“目录”中编写myTABLE。

  1. For the Security tab, I have tried all four options given. 对于“安全性”选项卡,我尝试了给出的所有四个选项。 (In the last option, I typed the login for MySQL DB and also for SQL Server) (在最后一个选项中,我输入了MySQL DB和SQL Server的登录名)
  2. For the Server Options tab, I have tried given RPC and RPC out (both in TRUE or both in FALSE) 对于“服务器选项”选项卡,我尝试给出RPC和RPC out(均为TRUE或均为FALSE)

I also have to mention that the database SQL Server is not my own one, so I don't have full credentials. 我还必须提到,数据库SQL Server不是我自己的数据库,因此我没有完整的凭据。 This is my user's permissions from SECURITY > LOGINS. 这是我的用户从“安全性”>“登录”获得的权限。

我的登录属性


My conclusion: I think it is about MS SQL SERVER MANAGEMENT STUDIO configuration or my permissions as the user. 我的结论:我认为这与MS SQL SERVER MANAGEMENT STUDIO配置或我作为用户的权限有关。

Thanks for your help! 谢谢你的帮助!


Update: 更新:

I have followed the advise given by TallTed , it didn't work as yet. 我遵循了TallTed的建议,但该建议尚未奏效。

第一次更新

In the Security and Server Options tabs, I have left them as shown in the previous screenshots. 在“安全性”和“服务器选项”选项卡中,我保留了它们,如先前的屏幕快照所示。 I have also tried all the ODBC connections shown in the screenshot. 我还尝试了屏幕快照中显示的所有ODBC连接。

Any other ideas? 还有其他想法吗? Thanks for your help! 谢谢你的帮助!

First off -- the error you've shown has nothing to do with your SQL Server user permissions. 首先-您显示的错误与SQL Server用户权限无关。

Next -- it's important to remember that Microsoft SQL Server isn't really an ODBC client application. 接下来-请记住Microsoft SQL Server并不是真正的ODBC客户端应用程序,这一点很重要。 It is an OLE DB and an ADO.NET client application. 它是一个OLE DB和ADO.NET客户端应用程序。

Also note -- 64-bit SQL Server requires a 64-bit ODBC driver; 另请注意-64位SQL Server需要64位ODBC驱动程序; 32-bit SQL Server requires a 32-bit ODBC driver. 32位SQL Server需要32位ODBC驱动程序。 There are some extra gotchas with 64-bit SQL Server, as described in this article on my employer's site . 我的雇主网站上的本文所述,64位SQL Server还有一些额外的陷阱。

If your data is strictly 8-bit "narrow" codepages, then you do not need a Unicode driver, and will probably find it easier to work with the ANSI driver. 如果您的数据严格是8位“窄”代码页,则您不需要Unicode驱动程序,并且可能会发现使用ANSI驱动程序更容易。 That said, given that you have ODBC 5.3 Unicode (32-bit) working with Access, I would think you'll have success using that or ODBC 5.3 Unicode (64-bit) with SQL Server. 就是说,假设您具有使用Access的ODBC 5.3 Unicode(32位) ,我认为您可以在SQL Server上使用该ODBC 5.3 Unicode(64位)获得成功。

Now -- a possible step toward success. 现在-迈向成功的可能一步。 In your first screenshot, Product Name must be MSDASQL . 在您的第一个屏幕截图中, 产品名称必须为MSDASQL You will need no Provider String , because this string comes from your ODBC DSN. 您不需要提供程序字符串 ,因为此字符串来自ODBC DSN。

I solved it! 我解决了! I was using a client computer. 我正在使用客户端计算机。 I installed the driver in the server and then followed this post: https://www.mssqltips.com/sqlservertip/4570/access-mysql-data-from-sql-server-via-a-linked-server/ 我在服务器中安装了驱动程序,然后关注以下帖子: https : //www.mssqltips.com/sqlservertip/4570/access-mysql-data-from-sql-server-via-a-linked-server/

Thanks and I hope it would help someone! 谢谢,希望对您有所帮助!

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

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