windows 2008上启用防火墙后sqlserver出现连接超时的解决办法

2年前 (2022) 程序员胖胖胖虎阿
186 0 0

昨日将sqlserver2005从windows2003迁移到windows2008系统上后,发现经常打开网页时提示sql server连接超时,但是有时候又是正常的,一开始一直以为是网络连接不好,后来发现超时时,远程连接完全正常,所以排除了这一因素,查看防火墙,发现1433端口tcp,udp也是允许通过的,无奈只能百度,发现在windows2008上除了1433,还有其它端口需要打开,这里把网上的资料整理了一个批处理文件,大家把下面的内容保存成openSql.bat,以管理员身份登录windows2008后双击运行即可

@echo =========  SQL Server 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 =========  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 =========  Misc Applications  ==============
@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

 

 

原文出处:http://www.cnblogs.com/yjmyzz/archive/2009/07/18/1526090.html

相关文章

暂无评论

暂无评论...