SQL Server Management Studio Express 和 MySQL?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8739022/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 22:14:41  来源:igfitidea点击:

SQL Server Management Studio Express and MySQL?

mysqlssms

提问by EOB

Is there a way to use SQL Server Management Studio Express together with a MySQL database? I guess even if it works, intellisense wont work?

有没有办法将 SQL Server Management Studio Express 与 MySQL 数据库一起使用?我想即使它有效,智能感知也不起作用?

Thanks!

谢谢!

采纳答案by rkosegi

It will not works with MySQL.The name of product is "SQL Server Management Studio", so it manages SQL Server instances.

它不适用于 MySQL。产品名称是“SQL Server Management Studio”,因此它管理 SQL Server 实例。

If you need tool with similar functionality, try Toad for MySQL, it's freeware or Oracle SQLDeveloper.

如果您需要具有类似功能的工具,请尝试使用 Toad for MySQL,它是免费软件或 Oracle SQLDeveloper。

回答by Fred



I don't know if you found the answer yet, but the following links can help:

1- HOWTO: Setup SQL Server Linked Server to MySQL
2- Creating Linked server to MYSQL from SQL Server



我不知道您是否找到了答案,但以下链接可以提供帮助:

1- HOWTO: Setup SQL Server Linked Server to MySQL
2- Creating Linked server to MYSQL from SQL Server

回答by TBohnen.jnr

I can't see how this will ever work, SSMS is written only for MSSQL.

我看不出这将如何工作,SSMS 只为 MSSQL 编写。

You can however create a link server to the mysql database and use it that way, I doubt intellisense will work though. see herefor more info.

但是,您可以创建一个到 mysql 数据库的链接服务器并以这种方式使用它,但我怀疑智能感知是否会起作用。请参阅此处了解更多信息。

回答by Francesco Mantovani

Yes, you can.

是的你可以。

I think this answer needs to be updated and as we now live in a Cloud world I have created a proof of concept for you, fellas.

我认为这个答案需要更新,因为我们现在生活在云世界中,我已经为你们创建了一个概念证明,伙计们。

  1. Download MySQL ODBC driver: https://dev.mysql.com/downloads/connector/odbc/and install
  2. Go to ODBC Data Source Administrator > User DNS > Add..., and fill all the fields wit the right informations. Then test if the connections works enter image description here
  3. Go to ODBC Data Source Administrator > System DNS > Add..., and fill all the fields wit the right informations. Then test if the connections works enter image description here
  4. In SSMS go to Server Objects > Linked Servers > New Linked Server... enter image description here
  5. Under General set
    • Linked server: (Put what you want, I put the name of the server for simplicity)
    • Provider: Microsoft OLE DB Provider for ODBC Drivers
    • Product name: (Put what you want, I put the name of the server for simplicity, you might want to put MySQL)
    • Data source: Must have the same name as the System Data Source's Nameenter image description here
  6. Under Security select "Be made using this security context" and enter you user and password for remote login to MySQL enter image description here
  7. Under Server Options set RPC and RPC Out as True enter image description here
  8. Go to Server Objects > Linked Servers > Providers > MSDASQL, and enable: Nested queries, Level zero only, Allow inprocess, Supports 'Like' operator enter image description here
  9. Restart SQL Server and SQL Server Agent
  10. You can now query MySQL from SSMS using this structure:

    select * from OPENQUERY(linked_server_name, 'SELECT * FROM database_name.table_name')

  1. 下载 MySQL ODBC 驱动程序:https: //dev.mysql.com/downloads/connector/odbc/并安装
  2. 转到 ODBC 数据源管理器 > 用户 DNS > 添加...,并用正确的信息填写所有字段。然后测试连接是否有效 在此处输入图片说明
  3. 转到 ODBC 数据源管理器 > 系统 DNS > 添加...,并用正确的信息填写所有字段。然后测试连接是否有效 在此处输入图片说明
  4. 在 SSMS 中,转到服务器对象 > 链接服务器 > 新建链接服务器... 在此处输入图片说明
  5. 在通用集下
    • 链接服务器:(放你想要的,为了简单起见我把服务器的名字放了)
    • 提供程序:Microsoft OLE DB Provider for ODBC Drivers
    • 产品名称:(放你想要的,为了简单我放了服务器的名字,你可能想放MySQL)
    • 数据源:必须与系统数据源的名称同名在此处输入图片说明
  6. 在安全下选择“使用此安全上下文”并输入您的用户名和密码以远程登录到 MySQL 在此处输入图片说明
  7. 在服务器选项下将 RPC 和 RPC Out 设置为 True 在此处输入图片说明
  8. 转到服务器对象 > 链接服务器 > 提供程序 > MSDASQL,并启用:嵌套查询、仅级别零、允许进程内、支持“喜欢”运算符 在此处输入图片说明
  9. 重新启动 SQL Server 和 SQL Server 代理
  10. 您现在可以使用以下结构从 SSMS 查询 MySQL:

    select * from OPENQUERY(linked_server_name, 'SELECT * FROM database_name.table_name')

or simply:

或者干脆:

SELECT * FROM linked_server_name...table_name

enter image description here

在此处输入图片说明