简体   繁体   中英

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. The reason is that our website is built using PHP and MySQL and we need to manage the database from SQL Server Manag. Studio.

I have already linked MySQL to MS ACCESS, so MySQL ODBC drivers are fully working.

When I try to link them from MICROSOFT SQL SERVER MANAGEMENT STUDIO > SERVER OBJECTS > LINKED SERVERS > NEW LINKED SERVER...

With this configuration:

配置的第一个选项卡

配置的第二个选项卡

配置的第三个选项卡

I get this error:

错误7303


I have tried with all these versions of MySQL OBDC Drivers:

  • ODBC 5.3 Unicode (32-bit) - This one is the one working with MS ACCESS
  • ODBC 5.3 ANSI (32-bit)
  • ODBC 5.3 Unicode (64-bit)
  • ODBC 5.3 ANSI (64-bit)
  • ODBC 8.0 Unicode (64-bit)
  • ODBC 8.0 ANSI (64-bit)

ODBC系统配置


For the NEW LINKED SERVER:

  1. I have tried writing this in "Provider string":

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

    • ODBC:DSN=KARALIGROUP32::Table=myTABLE

I have also tried writing myTABLE in "Catalog".

  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)
  2. For the Server Options tab, I have tried given RPC and RPC out (both in TRUE or both in FALSE)

I also have to mention that the database SQL Server is not my own one, so I don't have full credentials. 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.

Thanks for your help!


Update:

I have followed the advise given by TallTed , it didn't work as yet.

第一次更新

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.

Any other ideas? Thanks for your help!

First off -- the error you've shown has nothing to do with your SQL Server user permissions.

Next -- it's important to remember that Microsoft SQL Server isn't really an ODBC client application. It is an OLE DB and an ADO.NET client application.

Also note -- 64-bit SQL Server requires a 64-bit ODBC driver; 32-bit SQL Server requires a 32-bit ODBC driver. There are some extra gotchas with 64-bit SQL Server, as described in this article on my employer's site .

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. 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.

Now -- a possible step toward success. In your first screenshot, Product Name must be MSDASQL . You will need no Provider String , because this string comes from your 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/

Thanks and I hope it would help someone!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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