打开端口 SQL Server 实例 [英] Opening Ports SQL Server Instances

查看:54
本文介绍了打开端口 SQL Server 实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

他们最近封锁了我们 SQL Server 上的所有端口.服务器有不同的实例,打开端口 1433 不起作用.我们需要打开什么才能访问 SQL Server?

They recently blocked all the ports on our SQL Server. The Server has different instances, and opening port 1433 didn't work. What do we need to open up to allow access to SQL Server?

推荐答案

在安装了服务器实例的计算机上:

On the computer where the server instance are installed:

  1. 启动 SQL Server 配置管理器实用程序.
  2. 打开树控件上的 SQL Server 网络配置节点,您应该会看到每个服务器实例的一个子节点.
  3. 对于每个实例,选择其节点并注意是否启用了 TCP/IP 协议(​​如果未启用,则没有端口).
  4. 右键单击 TCP/IP 协议条目并从上下文菜单中选择属性.这将打开 TCP/IP 属性对话框.
  5. 转到IP 地址"选项卡并向下滚动到底部的IPAll"部分以查看 TCP 端口.

如果您之前没有配置过您的服务器,您可能正在使用动态端口.这不是您想要的,因为端口可能会更改:这将使您的防火墙设置无效.因此,只需清除 TCP 动态端口条目并在 IPAll 的 TCP 端口条目中输入当前动态端口号.重新启动服务器实例后,服务器将固定到该端口.

If you haven't configured your servers previously, you are probably using dynamic ports. This is not what you want, because the port could change: that will invalidate your firewall settings. So, just clear the TCP Dynamic Ports entry and enter the current dynamic port number in the TCP Port entry for IPAll. After you restart the server instance, the server will be pinned to that port.

一个后续注意:如果您想通过实例名称从防火墙外部引用服务器,则必须允许 SQL Server Browser 通过防火墙,即 UDP 端口 1434.在我看来,它更好从外部通过端口引用实例,而不必担心 SQL 浏览器.例如,不要在连接字符串中使用 MYSERVER\SQLEXPRESS,而是使用 MYSERVER.mydomain.com,12345(在本例中 SQLEXPRESS 在端口 12345 上运行).请注意,连接字符串中的端口语法使用逗号分隔符,而不是用于 http uri 的冒号分隔符.

One follow-up note: if you want to reference the servers from outside the firewall by instance name, you'll have to allow the SQL Server Browser through the firewall, which is UDP port 1434. In my view it is better to reference instances by port from outside and don't worry about the SQL Browser. For example, instead of using MYSERVER\SQLEXPRESS in your connection string, use MYSERVER.mydomain.com,12345 (in this example SQLEXPRESS is running on port 12345). Note that the port syntax in a connection string uses a comma delimiter instead of the colon delimiter used for an http uri.

这篇关于打开端口 SQL Server 实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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