You are currently offline, waiting for your internet to reconnect

How to open the firewall port for SQL Server on Windows Server 2008

Extended support for SQL Server 2005 ends on April 12, 2016

If you are still running SQL Server 2005 after April 12, 2016, you will no longer receive security updates and technical support. We recommend upgrading to SQL Server 2014 and Azure SQL Database to achieve breakthrough performance, maintain security and compliance, and optimize your data platform infrastructure. Learn more about the options for upgrading from SQL Server 2005 to a supported version here.

Summary
Windows Firewall on Windows Server 2008 helps prevent unauthorized access to computer resources. However, if the firewall is configured incorrectly, attempts to connect to an instance of Microsoft SQL Server may be blocked. To access an instance of SQL Server that is behind the firewall, you must configure the firewall on the computer that is running SQL Server.

This article helps you open the firewall ports for SQL Server on Windows Server 2008.

To have us fix this problem for you, go to the "Fix it for me" section. If you prefer to fix this problem yourself, go to the "Let me fix it myself" section.
Fix it for me
To fix this problem automatically, click the Fix this problem link. Click Run in the File Download dialog box, and then follow the steps in this wizard.





Note This wizard may be in English only, but the automatic fix also works for other language versions of Windows.

Note If you are not on the computer that has the problem, save the Fix it solution to a flash drive or a CD and then run it on the computer that has the problem.

Next, go to the "Did this fix the problem?" section.
Let me fix it myself
The script that is discussed in this section opens the firewall ports for SQL Server.

To create the script, follow these steps:
  1. Start Notepad.
  2. Copy and paste the following code into Notepad:

    netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80@echo =========  SQL Server Ports  ===================@echo Enabling SQLServer default instance port 1433netsh advfirewall firewall add rule name="SQL Server" dir=in action=allow protocol=TCP localport=1433@echo Enabling Dedicated Admin Connection port 1434netsh advfirewall firewall add rule name="SQL Admin Connection" dir=in action=allow protocol=TCP localport=1434@echo Enabling Conventional SQL Server Service Broker port 4022netsh advfirewall firewall add rule name="SQL Service Broker" dir=in action=allow protocol=TCP localport=4022@echo Enabling Transact SQL/RPC port 135netsh advfirewall firewall add rule name="SQL Debugger/RPC" dir=in action=allow protocol=TCP localport=135@echo =========  Analysis Services Ports  ==============@echo Enabling SSAS Default Instance port 2383netsh advfirewall firewall add rule name="Analysis Services" dir=in action=allow protocol=TCP localport=2383@echo Enabling SQL Server Browser Service port 2382netsh advfirewall firewall add rule name="SQL Browser" dir=in action=allow protocol=TCP localport=2382@echo =========  Misc Applications  ==============@echo Enabling HTTP port 80netsh advfirewall firewall add rule name="HTTP" dir=in action=allow protocol=TCP localport=80@echo Enabling SSL port 443netsh advfirewall firewall add rule name="SSL" dir=in action=allow protocol=TCP localport=443@echo Enabling port for SQL Server Browser Service's 'Browse' Buttonnetsh advfirewall firewall add rule name="SQL Browser" dir=in action=allow protocol=UDP localport=1434@echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)netsh firewall set multicastbroadcastresponse ENABLE
  3. Save the file as a .txt file by using the following name: OpenSqlServerPort.txt
  4. Rename the OpenSqlServerPort.txt file to the following: OpenSqlServerPort.bat


Before you run the OpenSqlServerPort.bat script, you must copy the script to the computer that has the firewall and then run the script on that computer. To run the script, follow these steps:
  1. Click Start, click Run, type cmd, and then click OK.
  2. At the command prompt, use the cd command to move to the folder in which you saved the OpenSqlServerPort.bat file.
  3. To run the OpenSqlServerPort.bat script, type OpenSqlServerPort.bat at the command prompt, and then press Enter.
Did this fix the problem?
Check whether the problem is fixed by trying to access the instance of SQL Server from another computer. If the problem is fixed, you are finished with this article. If the problem is not fixed, you can contact support.
Windows firewall port SQL Server Windows Server 2008 fixit fix it
Properties

Article ID: 968872 - Last Review: 07/12/2013 08:55:00 - Revision: 6.1

Microsoft SQL Server 2005 Developer Edition, Microsoft SQL Server 2005 Enterprise Edition, Microsoft SQL Server 2005 Standard Edition, Microsoft SQL Server 2008 Developer, Microsoft SQL Server 2008 Enterprise, Microsoft SQL Server 2008 Standard, Microsoft SQL Server 2008 Web, Windows Server 2008 Datacenter without Hyper-V, Windows Server 2008 Enterprise without Hyper-V, Windows Server 2008 for Itanium-Based Systems, Windows Server 2008 Standard without Hyper-V, Windows Server 2008 Datacenter, Windows Server 2008 Enterprise, Windows Server 2008 Standard, Microsoft SQL Server 2008 R2 Developer, Microsoft SQL Server 2008 R2 Enterprise, Microsoft SQL Server 2008 R2 Standard, Microsoft SQL Server 2008 R2 Web

  • kbsqlsetup kbmsifixme kbtshoot kbsurveynew kbfixme KB968872
Feedback