访问SQL Server数据库根据系统平台的不同,访问方法也不太一样。下面就为您详细介绍Windows Server2008上访问SQL Server的方法,希望对您学习访问SQL Server方面能有所帮助。
Windows Server 2008上的Windows防火墙有助于防止未经授权的访问计算机资源。但是,系统默认没有打开SQL Server及相关服务的端口。若要访问的是在防火墙后面SQL Server实例,必须将服务器防火墙相关端口打开。
以下脚本自动配置打开SQL Server的默认服务端口:
@echo ========= SQL Server Ports ===================@echo Enabling SQLServer default instance port 1433netsh firewall set portopening TCP 1433 "SQLServer" @echo Enabling Dedicated Admin Connection port 1434netsh 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 2383netsh firewall set portopening TCP 2383 "Analysis Services" @echo Enabling SQL Server Browser Service port 2382netsh 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 443netsh firewall set portopening TCP 443 "SSL" @echo Enabling port for SQL Server Browser Service's 'Browse' Buttonnetsh firewall set portopening UDP 1434 "SQL Browser" @echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)netsh firewall set multicastbroadcastresponse ENABLE
【编辑推荐】