開啟 MS SQL Server 的防火牆
正常情況安裝完 MS SQL SERVER 後,防火牆都還需要手動打開,SQL SERVER要去開放網路連線協定,我這邊提供一次搞定的批次檔,只要下載到電腦中,並且用管理員權限執行就可以了,以下示範一下如何打開以及注意事項
示範用的環境
- Windows server 2022
- SQL Server 2022
SQL Server Configuration Manager的設定
要先打開 SQL 的服務,所以先到 SQL Configuration Manager 中,把 TCP/IP 的協定打開
防火牆設定
MS SQL SERVER 預設的 PORT 是 1433,打開這一個就可以正常連線
使用 Script 將所有的防火牆設定一次搞定
@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
近期留言