Introduction
This article explains how to configure an instance of the SQL Server Database Engine to listen on a particular fixed port by utilising the SQL Server Configuration Manager to fix SQL error 26. In my earlier article, I have thoroughly highlighted how to get database tables size in SQL Server. The default example of the SQL Server Database Engine responses (listens) especially on TCP port 1433. Named instances of the Database Engine and SQL Server Compact are arranged for dynamic ports. This implies they select an accessible port when the SQL Server administration is started over. When you are interacting with a named instance through a firewall, configure the Database Engine to listen on a particular port, so that the fitting port can be opened in the firewall.Error Description:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)
Step 1: Run this query to view your TCP endpoints
SELECT name, protocol_desc, type_desc, state_desc, is_admin_endpoint, port, is_dynamic_port, ip_address FROM sys.tcp_endpoints
Step 2: Check for which SQL port is working
We can apply apply given below T-SQL command to check which port is working:USE MASTER GO xp_readerrorlog 0, 1, N'Server is listening on' GO
Step 3: Run below command to check applications listening on ports, try this command on command line:
>>> netstat -ap TCPStep 4: Open immediate Run command (Windows + R) in your system
1) Now type on immediate Run command %windir%\System32\cliconfg.exe2) Click on OK button then check an TCP ip pop-up is open
3) Left side you will see disabled protocols and right side disabled protocols.
4) Now select TCP/IP and click on "Enable", it will add to right side enabled protocols.
5) Now click on added protocols TCP/IP and hit "Properties" button and enter/verify SQL Server desired TCP/IP no, SQL Server default port is 1433.
6) At last, now hit OK button.
Figure 1 |
Figure 2 |
Figure 3 |
Step 5: Open "SQL Server Configuration Manager"
- Now Click on "SQL Server Network Configuration" OR run immediate window, type SQLServerManager10.msc to quick access to SQL Server Configuration Manager and Click on "Protocols for Name"
- Right Click on "TCP/IP" (make sure it is Enabled) Click on Properties, if it is Disabled then Enabled it.
- Now Select "IP Addresses" I to VI Tab and Enter TCP Default Port
- Enter "TCP Port" 1433.
- TCP Dynamic Ports ===> remove 0 (keep blank).
- Now Restart "SQL Server Name." using "services.msc" (winKey + r)
- OR Restart SQL Server (right click on SQL Server Management studio and then click on Restart, it will restart your SQL Server).
Figure 1 |
Figure 2 |
Figure 3 |
Figure 4 |
Figure 5 |
Does not work for me :(
ReplyDeleteDid you go carefully all steps? I faced this many times, I resolved the same issue in the same way many times.
Delete