Solution for SQL Server Connection Issues Over the Network
Problem Statement
When attempting to connect from a client (e.g., Windows 11) to a SQL Server instance RUBINHOOD, connection errors may occur. Error messages such as "SQL Server does not exist or access denied" or "SQL Server Error: 17" indicate that the server is unreachable.
The problem is often due to one of the following reasons:
- TCP/IP protocol is not enabled
- SQL Server is listening on a dynamic port instead of 1433
- Firewall is blocking the SQL Server port
- SQL Server Browser service is disabled
This article provides a step-by-step guide to resolving these issues based on a troubleshooting process with screenshots.
Step 1: Verify that TCP/IP is Enabled
- Open SQL Server Configuration Manager (Win + R, then enter
SQLServerManagerXX.msc
, where XX is the SQL version). - Navigate to "SQL Server Network Configuration" > "Protocols for RUBINHOOD".
- Ensure that TCP/IP is enabled.
- If TCP/IP is disabled, right-click > Enable.
- Restart the SQL Server service.
Result: SQL Server RUBINHOOD now accepts connections over TCP/IP.
Step 2: Set a Static Port 1433
- Double-click on "TCP/IP" > Go to the "IP Addresses" tab.
- Scroll down to "IPAll".
- Clear "TCP Dynamic Ports" (must be empty).
- Set "TCP Port" to 1433.
- Restart the SQL Server service.
Result: SQL Server RUBINHOOD now uses the standard port 1433, which is required for remote connections.
Step 3: Configure Firewall for SQL Server RUBINHOOD
- Open Windows PowerShell as Administrator (Win + X > "PowerShell (Admin)").
- Run the following command to allow the port through the firewall:
New-NetFirewallRule -DisplayName "Allow SQL Server 1433" -Direction Inbound -Protocol TCP -LocalPort 1433 -Action Allow
Result: SQL Server RUBINHOOD is now accessible over the network.
Step 4: Test the Connection from a Client
- Open PowerShell on another machine (e.g., Windows 11 client).
- Run the following command to test network connectivity:
Test-NetConnection -ComputerName 192.168.178.3 -Port 1433
- If
TcpTestSucceeded = True
, the port is reachable. - If
False
, check the firewall and network settings again.
Result: SQL Server RUBINHOOD is now accessible from the network.
Step 5: Test Connection with SQL Server Management Studio (SSMS) or ODBC
- Open SSMS or ODBC Data Source Administrator on the client.
- Enter the server name:
- If default instance:
192.168.178.3
- If named instance RUBINHOOD:
192.168.178.3\RUBINHOOD
- If specifying the port explicitly:
192.168.178.3,1433
- If default instance:
- Test the connection.
Example ODBC Error Message
If the connection fails, you may see an error like this:
This error typically indicates that:
- The server is unreachable due to a firewall or network issue.
- TCP/IP is not enabled.
- SQL Server is not listening on the correct port.
To resolve this, ensure that TCP/IP is enabled, the firewall allows connections, and the correct port (1433) is set in SQL Server Configuration Manager.
Result: Successful connection to SQL Server RUBINHOOD over the network!
Conclusion
By correctly configuring TCP/IP, setting a fixed port (1433), and adjusting firewall rules, the connection issue was resolved. If errors persist, check:
- Whether the SQL Server service is running (
Get-Service -Name "MSSQL$RUBINHOOD"
) - If SQL Server authentication is properly configured
- If domain policies allow access to SQL Server RUBINHOOD
Hopefully, this guide helps you resolve SQL Server RUBINHOOD network issues!