使用SQL Server Management Studio远程连接到Docker容器 [英] Using SQL Server Management Studio to remote connect to docker container

查看:396
本文介绍了使用SQL Server Management Studio远程连接到Docker容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文:我正在尝试构建一个开发SQL Server,以便继续学习SQL并使用Microsoft SQL Server Management Studio( SSMS )可以在Windows PC上进行访问。

Context: I am trying to build a development SQL Server that I can continue to learn SQL on and use Microsoft SQL Server Management Studio (SSMS) to access on a Windows PC.

所以我将AdventureWorks数据库安装在运行DigitalOcean Ubuntu 16.04的MS SQL Server 2017的Docker容器上。我可以从Mac远程SSH到服务器,访问容器并查询数据库。

So I have the AdventureWorks database sitting on a Docker Container for MS SQL Server 2017 running on a DigitalOcean Ubuntu 16.04 box. From my Mac I can remote SSH in to the server, access the container and query the database.

但是我希望在Windows PC上使用SSMS,但不确定如何开始连接到远程盒。在下面的图片中,没有任何选项可以指定SSH密钥甚至登录Ubuntu框,仅用于访问SQL Server。

However I wish to use SSMS on my Windows PC and am unsure how I begin to connect to the remote box. In the picture below, there are no options to specify an SSH key or to even login in to the Ubuntu box, only to access the SQL server.

这甚至可能吗?

推荐答案

使用公共IP地址通过SSMS连接,然后使用逗号分隔符,然后是端口(xxx.xx.xx.xxx,port)

connect via SSMS using the public IP address, followed by comma separator and then the port (xxx.xx.xx.xxx,port)

您还需要sa凭证才能完成这项工作。

You'll also need the sa credentials to make this work.

这篇关于使用SQL Server Management Studio远程连接到Docker容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆