sql server端口_SQL Server端口概述

sql server端口

This article is useful for a beginner in SQL Server administration and gives insights about the SQL Server Ports, the methods to identify currently configured ports.

本文对于SQL Server管理的初学者很有用,并提供有关SQL Server端口(识别当前配置的端口的方法)的见解。

介绍 (Introduction)

We can define the port as an endpoint of service for communication purposes. It might bind to a particular application or service. Once we install SQL Server, it configures default ports for SQL Server services. Each client application uses the combination of IP addresses and port number to connect to SQL Server.

出于通信目的,我们可以将端口定义为服务的端点。 它可能绑定到特定的应用程序或服务。 安装SQL Server后,它将为SQL Server服务配置默认端口。 每个客户端应用程序使用IP地址和端口号的组合来连接到SQL Server。

We can have two kinds of SQL Server Ports in SQL Server.

SQL Server中可以有两种SQL Server端口。

  1. Static Port: A static port is always bound to a service or application. It does not change due to a service or system restart. By default, SQL Server uses static TCP port number 1433 for the default instance MSSQLSERVER. If you configure SQL Server to use a static port other than the default port, you should communicate it to the clients or application owners to specify in the connection string 静态端口:静态端口始终绑定到服务或应用程序。 由于服务或系统重启,它不会更改。 默认情况下,SQL Server使用静态TCP端口号1433作为默认实例MSSQLSERVER。 如果将SQL Server配置为使用默认端口以外的静态端口,则应将其传达给客户端或应用程序所有者,以在连接字符串中指定
  2. Dynamic Port: You can configure SQL Server to use a dynamic port. If you use dynamic port allocation, you specify port number zero in the network configuration. Once SQL Service restarts, it requests a free port number from the operating system and assigns that port to SQL Server. 动态端口:您可以将SQL Server配置为使用动态端口。 如果使用动态端口分配,请在网络配置中将端口号指定为零。 SQL Service重新启动后,它将向操作系统请求一个空闲端口号,并将该端口分配给SQL Server。

    As you know, Application uses a combination of SQL Server IP address and port number, you might think of a question – How will an application know the port number for connecting to SQL Server?

    如您所知,Application使用SQL Server IP地址和端口号的组合,您可能会想到一个问题– 应用程序如何知道用于连接到SQL Server的端口号?

Once the operating system allocates a dynamic SQL Server Port to SQL Server, it writes that port number in the Windows registry. SQL Server Browser service uses UDP static port 1434. It reads the registry for the assigned TCP port. SQL Server client library connects and sends a UDP message using port 1434. SQL Server Browser service gives back the port number of a specific instance. An application can connect to SQL Server using that dynamic SQL Server port. SQL Server default instance uses the static port; therefore, SQL Server Browser does not return port for the default instance.

操作系统将动态SQL Server端口分配给SQL Server之后,它将在Windows注册表中写入该端口号。 SQL Server Browser服务使用UDP静态端口1434。它读取分配的TCP端口的注册表。 SQL Server客户端库使用端口1434连接并发送UDP消息。SQLServer Browser服务返回特定实例的端口号。 应用程序可以使用该动态SQL Server端口连接到SQL Server。 SQL Server默认实例使用静态端口。 因此,SQL Server浏览器不会为默认实例返回端口。

In most of the cases, SQL Server uses the same dynamic the SQL Server Port upon restart of the SQL Service as well. Suppose you stopped SQL Services and operating system allocated the dynamic port number (previously assigned to SQL) to another service, SQL Server gets another dynami

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值