Configure a Windows Firewall for Database Engine Access - SQL Server (2024)

  • Article

Applies to: Configure a Windows Firewall for Database Engine Access - SQL Server (1) SQL Server

This article describes how to configure a Windows Firewall for Database Engine access in SQL Server by using SQL Server Configuration Manager. Firewall systems help prevent unauthorized access to computer resources. To access an instance of the SQL Server Database Engine through a firewall, you must configure the firewall on the computer running SQL Server to allow access.

For more information about the default Windows Firewall settings, and a description of the TCP ports that affect the Database Engine, Analysis Services, Reporting Services, and Integration Services, see Configure the Windows Firewall to Allow SQL Server Access. There are many firewall systems available. For information specific to your system, see the firewall documentation.

The principal steps to allow access are:

  1. Configure the Database Engine to use a specific TCP/IP port. The default instance of the Database Engine uses port 1433, but that can be changed. The port used by the Database Engine is listed in the SQL Server error log. Instances of SQL Server Express, SQL Server Compact, and named instances of the Database Engine use dynamic ports. To configure these instances to use a specific port, see Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager).

  2. Configure the firewall to allow access to that port for authorized users or computers.

Note

The SQL Server Browser service lets users connect to instances of the Database Engine that are not listening on port 1433 without knowing the port number. To use SQL Server Browser, you must open UDP port 1434. To promote the most secure environment, leave the SQL Server Browser service stopped, and configure clients to connect using the port number.

By default, Microsoft Windows enables the Windows Firewall, which closes port 1433 to prevent Internet computers from connecting to a default instance of SQL Server on your computer. Connections to the default instance using TCP/IP are not possible unless you open port 1433. The basic steps to configure the Windows firewall are provided in the following procedures. For more information, see the Windows documentation.

As an alternative to configuring SQL Server to listen on a fixed port and opening the port, you can list the SQL Server executable (Sqlservr.exe) as an exception to the blocked programs. Use this method when you want to continue to use dynamic ports. Only one instance of SQL Server can be accessed in this way.

Security

Opening ports in your firewall can leave your server exposed to malicious attacks. Make sure that you understand firewall systems before you open ports. For more information, see Security Considerations for a SQL Server Installation.

Using Windows Defender Firewall with Advanced Security

The following procedures configure the Windows Firewall by using the Windows Defender Firewall with Advanced Security Microsoft Management Console (MMC) snap-in. The Windows Defender Firewall with Advanced Security only configures the current profile. For more information about the Windows Defender Firewall with Advanced Security, see Configure the Windows Firewall to Allow SQL Server Access.

To open a port in the Windows Firewall for TCP access

  1. On the Start menu, select Run, type WF.msc, and then select OK.

  2. In the Windows Firewall with Advanced Security application, in the left pane, right-click Inbound Rules, and then select New Rule in the action pane.

  3. In the Rule Type dialog box, select Port, and then select Next.

  4. In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the Database Engine, such as 1433 for the default instance. Select Next.

  5. In the Action dialog box, select Allow the connection, and then select Next.

  6. In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Database Engine, and then select Next.

  7. In the Name dialog box, type a name and description for this rule, and then select Finish.

To open access to SQL Server when using dynamic ports

  1. On the Start menu, select Run, type WF.msc, and then select OK.

  2. In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then select New Rule in the action pane.

  3. In the Rule Type dialog box, select Program, and then select Next.

  4. In the Program dialog box, select This program path. Select Browse, and navigate to the instance of SQL Server that you want to access through the firewall, and then select Open. By default, SQL Server is at C:\Program Files\Microsoft SQL Server\MSSQLXX.MSSQLSERVER\MSSQL\Binn\Sqlservr.exe. Select Next. The MSSQLXX version will be specific to your version of SQL Server.

  5. In the Action dialog box, select Allow the connection, and then select Next.

  6. In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Database Engine, and then select Next.

  7. In the Name dialog box, type a name and description for this rule, and then select Finish.

See also

  • How to: Configure Firewall Settings (Azure SQL Database)
Configure a Windows Firewall for Database Engine Access - SQL Server (2024)

FAQs

How to allow SQL Server connection through Windows Firewall? ›

Allow the SQL Server applications in the Firewall
  1. Open Windows Control Panel and select System and Security.
  2. From the System and Security window, click the link to Allow an app through Windows Firewall.
  3. Allow the SQL Server Browser: ...
  4. Click the Browse button. ...
  5. Allow the SQL Server Application: ...
  6. Click the Browse button.

How to configure Windows Defender firewall to allow database access? ›

Open a port in the Windows Firewall for TCP access

In the Rule Type dialog box, select Port, and then select Next. In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the Database Engine, such as 1433 for the default instance. Select Next.

What firewall ports need to be open for SQL Server? ›

Ports used by the Database Engine. By default, the typical ports used by SQL Server and associated database engine services are: TCP 1433 , 4022 , 135 , 1434 , UDP 1434 .

How to open firewall port 1433 for SQL Server database? ›

Solution
  1. Connect to your SQL server.
  2. Open the Windows firewall.
  3. Click on Inbound Rules.
  4. Select New Rule.
  5. Select the Port type of the rule.
  6. Specify the ports 1433 and 1434 to which this rule applies inside the Specific local ports area. ...
  7. In this step, leave the default selection: Allow the connection.
Nov 17, 2022

How do I allow connections through Windows Firewall? ›

Symptoms
  1. Click the Start button, then type Windows Firewall in the Search box.
  2. Click Windows Firewall, and then click Allow a program or feature through Windows Firewall.
  3. Click the Change settings button. If a User Account Control window appears, click Yes, or enter your user name and password, then click OK.

How do I allow TCP IP connections to the SQL Server? ›

Enable TCP/IP in the SQL Server

Expand the Configuration Tools subfolder and right-click on SQL Server Configuration Manager. Click on Run as Administrator. Select SQL Server Network Configuration and click Protocols for SMTKINGDOM. In the right pane, right-click TCP/IP and click Enable.

How do I enable Microsoft Defender in SQL Server? ›

Enable Defender for SQL

In the Defender for Cloud menu, select Environment settings. Select the relevant subscription. On the Defender plans page, locate the Databases plan and select Select types. In the Resource types selection window, toggle the SQL servers on machines plan to On.

How to check if SQL Server is listening on port 1433? ›

You can check TCP/IP connectivity to SQL Server by using telnet. For example, at the command prompt, type telnet 192.168. 0.0 1433 where 192.168. 0.0 is the address of the computer that is running SQL Server and 1433 is the port it is listening on.

How to allow SQL Server to accept remote connections? ›

Use SQL Server Management Studio
  1. In Object Explorer, right-click a server and select Properties.
  2. Select the Connections node.
  3. Under Remote server connections, select or clear the Allow remote connections to this server check box.
Jul 22, 2024

What is the difference between port 1433 and 1434? ›

As we have already mentioned, the SQL Server Database Engine listens on port 1433 for the TCP/IP connections, and port 1434 is used for the UDP connections by default. However, if you are working with more than one SQL Server instance at the same time, you will have the default port numbers.

What is the default port for mssql database? ›

By default SQL Server listens on TCP port number 1433, but for named instances the TCP port is dynamically configured.

How to connect SQL Server with port number? ›

For example, if your server name is "MyServer" and the port number is "1234", you would use the following connection string: server=MyServer,1234;database=myDatabase;integrated security=true; When connecting with Microsoft SQL Server Management studio, enter port number with comma.

How do I configure SQL Server Express to allow remote TCP IP connections on port 1433? ›

Configure SQL Server machine
  1. Windows Firewall ->Advanced Settings->Inbound Rules. Add a rule to enable TCP port 1433 (default port for SQL Server)
  2. Enable SQL Service to listen on TCP/IP. Check SQL Server version and run appropriate version of SQL Configuration Manager to enable TCP.
  3. Restart SQL Server Service.
Feb 20, 2023

How do I change the default port 1433 in SQL Server? ›

Steps
  1. Change the port in the SQL Server Configuration Manager, and under the TCP/IP which has the layer of the IP v4 , v6 etc, and change the port accordingly.
  2. Then, the port number is only changed on the TCP port level at the SQL configuration.
  3. Change the page name, login.
Jan 28, 2020

Is 1433 port secure for SQL? ›

Several vulnerabilities come with using port 1433. These include injection attacks, which can lead to data breaches if not adequately mitigated.

How do I allow network connection to SQL Server? ›

Use SQL Server Management Studio
  1. In Object Explorer, right-click a server and select Properties.
  2. Select the Connections node.
  3. Under Remote server connections, select or clear the Allow remote connections to this server check box.
Jul 22, 2024

How do I allow external connections in SQL Server? ›

Configure SQL Server machine
  1. Windows Firewall ->Advanced Settings->Inbound Rules. ...
  2. Run SSMS (SQL Server Management Studio) on SQL Server machine. ...
  3. Server Properties - > Connections -> Allow Remote Connections ..” ...
  4. Add a SQL login (if not already there)
  5. Enable SQL Service to listen on TCP/IP. ...
  6. Restart SQL Server Service.
Feb 20, 2023

How do I allow access to SQL Server? ›

From the Object Explorer in Microsoft SQL Server Management Studio, right-click the desired Database and select Properties. Navigate to the Permissions page and select the desired User from the Users or roles list. From the Permissions for [username] list, grant the required explicit user permissions.

How do I allow the connection if it is secure in Windows Firewall? ›

Set Up the Client-side Firewall Rule

Select All programs and click Next. Select the Remote port (in this example, SMB: TCP 445), and then click Next. Select the ip addresses/ranges this rule applies to, and then click Next. Select Allow the connection if it is secure, and click Customize.

Top Articles
The 7 credit card tips that nobody usually tells newbies
Red Hot Penny Shares
11 beste sites voor Word-labelsjablonen (2024) [GRATIS]
SZA: Weinen und töten und alles dazwischen
Why Are Fuel Leaks A Problem Aceable
Nybe Business Id
Occupational therapist
Apnetv.con
Youtube Combe
Garrick Joker'' Hastings Sentenced
Pollen Count Central Islip
Programmieren (kinder)leicht gemacht – mit Scratch! - fobizz
Craigslist Pikeville Tn
Nioh 2: Divine Gear [Hands-on Experience]
Premier Reward Token Rs3
Katherine Croan Ewald
Transfer and Pay with Wells Fargo Online®
Dumb Money, la recensione: Paul Dano e quel film biografico sul caso GameStop
10-Day Weather Forecast for Santa Cruz, CA - The Weather Channel | weather.com
Traveling Merchants Tack Diablo 4
Qual o significado log out?
Lisas Stamp Studio
If you have a Keurig, then try these hot cocoa options
Apartments / Housing For Rent near Lake Placid, FL - craigslist
Mdt Bus Tracker 27
Acurafinancialservices Com Home Page
Times Narcos Lied To You About What Really Happened - Grunge
Waters Funeral Home Vandalia Obituaries
Cfv Mychart
Black Lion Backpack And Glider Voucher
3473372961
The Latest: Trump addresses apparent assassination attempt on X
Craigslist Maryland Baltimore
Western Gold Gateway
American Bully Xxl Black Panther
Quake Awakening Fragments
Acadis Portal Missouri
Omaha Steaks Lava Cake Microwave Instructions
Garland County Mugshots Today
Brauche Hilfe bei AzBilliards - Billard-Aktuell.de
Craigslist Woodward
Best Suv In 2010
Tito Jackson, member of beloved pop group the Jackson 5, dies at 70
Is Chanel West Coast Pregnant Due Date
Deshuesadero El Pulpo
Www Ventusky
Raley Scrubs - Midtown
Taterz Salad
Coldestuknow
32 Easy Recipes That Start with Frozen Berries
Latest Posts
Article information

Author: Laurine Ryan

Last Updated:

Views: 6306

Rating: 4.7 / 5 (77 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Laurine Ryan

Birthday: 1994-12-23

Address: Suite 751 871 Lissette Throughway, West Kittie, NH 41603

Phone: +2366831109631

Job: Sales Producer

Hobby: Creative writing, Motor sports, Do it yourself, Skateboarding, Coffee roasting, Calligraphy, Stand-up comedy

Introduction: My name is Laurine Ryan, I am a adorable, fair, graceful, spotless, gorgeous, homely, cooperative person who loves writing and wants to share my knowledge and understanding with you.