SQLServer默认使用动态端口,即每次启动sqlserver.exe时,端口port都会动态变化。若要使用静态端口,比如port=1433,则需要在SQL Server Configuration Manager(简称SSMS)里配置。这里以SQL Server 2005 Configuration Manager软件为例,进行说明,具体如下:
1 使能静态端口1433
点击桌面左下角的[开始] --》找到SQL ServerConfiguration Manager --》双击SQL ServerConfiguration Manager --》弹出Manager软件配置界面,如图(1)所示:

点开左侧目录里的SQL Server 2005 Network Configurtaion --》右击Protocols for XXX --》打开 --》再右击TCP/IP --》属性 --》
- 在Protocol页,
设置Enable = Yes,如图(2)、图(3)所示: - 在IP Address页
找到IPAll属性
设置 TCP Dynamic Ports 为空
设置 TCP Port = 1433。
–》点击【应用】,如图(4)所示:



2 重启SQL Server服务
2.1 先关闭SQL Server和SQL Server Browser
在SQL Server Configuration Manager界面,在左侧树形目录里选中SQL Server 2005 Services --》在右边选中SQL Server(SQLEXPRESS) --》关闭或Stop --》继续在右边选中SQL Server Browser–》关闭或Stop,如图(5)、图(6)所示:


2.1 再打开SQL Server和SQL Server Browser
在右边选中SQL Server(SQLEXPRESS) --》启动或Start --》继续在右边选中SQL Server Browser–》启动或Start,如图(7)、图(8)所示:


3 查看1433端口
按Win+R,输入:cmd --》再输入如下命令:
//查询1433对应的进程ID
netstat -ano|findstr "1433"
若打印 “TCP 0.0.0.0:1433 LISTENING”字符串,表示1433端口,已经被监听。

再根据PID,查询对应的EXE进程文件,如图(8)所示:
//查询PID=2692的进程exe
tasklist|findstr "2692"
若打印"sqlservr.exe"字符串,则说明SQlServer数据库已经绑定了1433端口,端口设置成功。

4 五种服务
Services名称 | 作用 | 说明 |
---|---|---|
SQL Server(SQLEXPRESS) | 核心服务,存储和处理Table或XML格式数据 | 必须启动 |
SQL Server Browser | 浏览服务,为数据库引擎和 SSAS 的每个实例提供实例名称和版本号 | 当有多个数据库连接时,需要启动Browser服务 |
SQL Server Report | 报表服务,生成各种各样的报表格式 | 按需启动 |
SQL Server Analysis | 分析服务,提供联机分析处理、数据挖掘技术支持 | 按需启动,企业级应用 |
SQL Server Integration | 集成服务,进行数据提取、转换和加载 (ETL) 的数据仓库工具 | 按需启动,企业级应用或Azure、Amazon云场景使用 |