SQL server 2008 防火墙设置

zh以前应为有特殊需求,需要在副武器外连接数据库,需要打开TCPIP服务。

但是因为有防火墙,经常连接不成功。

根据网上的资料总结,写了一个小的bat,来解决这个问题:

@echo =========  Open SQL Server Self Ports  ===================
@echo Enabling SQLServer default instance port 1433
netsh firewall set portopening TCP 1433 "SQLServer"

@echo Enabling Dedicated Admin Connection port 1434
netsh firewall set portopening TCP 1434 "SQL Admin Connection"

@echo Enabling conventional SQL Server Service Broker port 4022 
netsh firewall set portopening TCP 4022 "SQL Service Broker"

@echo Enabling Transact-SQL Debugger/RPC port 135
netsh firewall set portopening TCP 135 "SQL Debugger/RPC"


@echo ========= Open Analysis Services Ports  ==============
@echo Enabling SSAS Default Instance port 2383
netsh firewall set portopening TCP 2383 "Analysis Services"

@echo Enabling SQL Server Browser Service port 2382
netsh firewall set portopening TCP 2382 "SQL Browser"


@echo =========  Open Misc Applications Ports  ==============
@echo Enabling HTTP port 80
netsh firewall set portopening TCP 80 "HTTP"

@echo Enabling SSL port 443
netsh firewall set portopening TCP 443 "SSL"

@echo Enabling port for SQL Server Browser Service's 'Browse' Button
netsh firewall set portopening UDP 1434 "SQL Browser"

@echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)
netsh firewall set multicastbroadcastresponse ENABLE

如果要远程连接,请确认你的TCPIP协议是打开的,SQL Browser服务是开启的。

posted @ 2019-06-12 15:37  追风狂想  阅读(410)  评论(0编辑  收藏  举报