Why am I getting "Cannot Connect to Server - A network-related or instance-specific error"? Why am I getting "Cannot Connect to Server - A network-related or instance-specific error"? sql-server sql-server

Why am I getting "Cannot Connect to Server - A network-related or instance-specific error"?


I found the following techniques helpful:

  1. Make sure your database engine is configured to accept remote connections:

    • Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
    • Click on Surface Area Configuration for Services and Connections
    • Select the instance that is having a problem > Database Engine > Remote Connections
    • Enable local and remote connections
    • Restart instance
  2. You may need to create an exception on the firewall for the SQL Server instance and port you are using:

    • Start > Run > Firewall.cpl
    • Click on exceptions tab
    • Add sqlservr.exe (typically located in C:\Program Files (x86)\Microsoft SQL Server\MSSQL.x\MSSQL\Bin, check your installs for the actual folder path) and port (default is 1433)
    • Check your connection string as well
  3. Check if your SQL server services is up and running properly:

    • Go to All Programs > Microsoft SQL Server 2008 > Configuration Tools > SQL Server Configuration Manager > SQL Server Services
    • Check to make sure SQL Server service status is Running.

    In addition, ensure that your remote server is in the same network. Run sqlcmd -L to ascertain if your server is included in your network list.

  4. Enable TCP/IP in SQL Server Configuration

    When two or more SQL Servers are connected across network they do all communication using TCP/IP. The default port of SQL Server installation is 1433. This port can be changed through SQL Server Configuration Manager. TCP/IP should be enabled for SQL Server to be connected.

    • Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Server Configuration Manager >> Select TCP/IP
    • Right Click on TCP/IP >> Click on Enable

    You must restart SQL Server Services for all the changes to take effect. Right click and go to menu properties to select location where default port of SQL Server can be changed.


I got Solution for me :

Open "SQL Server Configuration Manager"

Now Click on "SQL Server Network Configuration" and Click on "Protocols for Name"

Right Click on "TCP/IP" (make sure it is Enabled) Click on Properties

Now Select "IP Addresses" Tab -and- Go to the last entry "IP All"

Enter "TCP Port" 1433.

Now Restart "SQL Server .Name." using "services.msc" (winKey + r)

It Will Work...


Adding my heavily upvoted comment as an answer with screenshots.

I spent a lot of time on this, finally what worked for me is:

1) Open Sql Server Configuration Manager --> SQL Server Network configuration --> Protocols for <(INSTANCE)> --> TCP/IP (double click on it).

enter image description here

2) Select --> IP Addresses(Tab).

3) Go to the last entry IP All and mention TCP Port 1433.

enter image description here

4) Press Win+R and enter services.msc.

5) Now restart SQL Server <(INSTANCE)>.

enter image description here

After this, the problem got resolved!