To allow remote access to the database by using the TCP/IP protocol by configuring Windows Firewall

Source: Internet
Author: User

Original: Configure Windows Firewall to allow remote access to the database using the TCP/IP protocol

This article applies to: 2005, 2008, 2008r2 all versions

In order to remotely access the SQL Server database through the TCP/IP protocol, the following points are required:

On servers running SQL Server, we must locate the port that SQL Server listens on and then add it to the "Allow inbound" Windows Firewall.

One: The port of SQL Server needs to be added to the firewall's inbound rules.

Two: If you cannot determine the port of the connection string, or if SQL Server is not listening on TCP 1433, add the UDP 1434 port that the SQL Server Browser service listens to in Windows Firewall. This is because:

A) If the TCP port is explicitly specified by the connection string, then a connection provider such as SQL Native client will use this port to connect to SQL Server, so SQL Server is not required at this time Browser service to find the appropriate port that SQL Server listens on.

b), if the port is not explicitly defined by the connection string, then the connection provider sends a UDP packet to port 1434. Therefore, if port 1434 is not turned on in Windows Firewall, the connection provider will not get the appropriate TCP port that SQL Server listens on. The connection provider then connects SQL Server with only 1433来. If SQL Server does not listen on port 1433 at this point, it will return a failure. Therefore, you also need to add the UDP1433 port to the Windows Firewall inbound rules.


In order to find out which port the SQL Server lock listens to, you can use the following steps:

1. Open SQL Server Configuration Manager

2. Under SQL Server Network Configuration node, click the protocol for the corresponding instance name. Double-click tcp/ip→ to switch to the IP Address tab, where you can find all ports that SQL Server listens on for each IP address or ports specified by all IP addresses.


NOTE: If SQL Server listens on a dynamic port, the table will be restarted after each reboot. So, you must find the port it is currently listening on, and then add it to Windows Firewall.

To allow remote access to the database by using the TCP/IP protocol by configuring Windows Firewall

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.