Out of DB Validation - Cannot connect to xxxx - A network-related or instance-specific error occurred while establishing a connection to SQL Server

Document created by TMACUL Champion on Jul 6, 2015
Version 1Show Document
  • View in full screen mode

When you are trying to install CA Service Desk, you may see the following message on install.log


Out of DB Validation.


Please try to connect using Microsoft SQL Server Management Studio, and...


if you cannot connect and see this message below


Cannot connect to xxxx - A network-related or instance-specific error occurred while establishing a connection to SQL Server


When you are trying to connect to a SQL Server using Microsoft SQL Server Management Studio, you may see the following message:


0361.SQLCannotConnect.JPG-550x0.jpg



1) SQL Server is not started. Starting of it will allow you to see your SQL Server/instance in the drop-down list of available SQL Servers.

a) Go to the Start menu -> Control Panel -> Administration Tools -> Services. (services.msc)

 

b) In the list of services find SQL Server and check its status, it must be Started (if it is not started, then right click on SQL Server and select Start from the context menu).

services_msc.jpg


Check SQLBrowser; check that it is running. You may also need to create an exception in your firewall for SQLBrowser.



2) Firewall is blocking port 1433 (MSSQL standard port for connections). It can be disabled following the steps below:

a) Go to the Start menu -> Control Panel -> Administration Tools -> Services.


b) Find Firewall service, it must be disabled (if it is not, then right click the service and select Stop from the context menu).

 


Note: More information on this can be found on the official Microsoft site: Configure the Windows Firewall to Allow SQL Server Access


Windows_Firewall.jpg


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 the sqlservr.exe (typically located in C:\Program Files (x86)\Microsoft SQL Server\MSSQL.x\MSSQL\Binn, check your installs for the actual folder path), and port (default is 1433)
• Check your connection string as well




3) TCP/IP protocol is disabled for MSSQL protocols. To enable it, see the steps below:

a) Navigate to SQL Server Configuration Manager in the Start menu.

 

b) Specify settings for TCP/IP protocol in SQL Server Configuration Manager.

 

c) Restart the computer.

 

Note: More information on this can be found on the official Microsoft site: How to: Enable the TCP/IP Protocol for a Database Instance 


sqlserverconfigurationmanager.jpg


sqlserverconfigurationmanager_Enable.jpg




4) Make sure your database engine is configured to accept remote connections (If you are using centralized database):

a) Open SQL Server Management Studio.


b) Right click SQL Server instance -> Properties -> Connections ->  Check the Allow remote connections to this server box.


c) Go to the General section and check name of SQL Server specified in the Name field.


allow_remote_connection.jpg


5) If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings. Usually the format needed to specify the database server is machinename\instancename.


If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application• Usually the format needed to specify the database server is machinename\instancename
• Check your connection string as well

<connectionStrings>

<add name="SampleConnectionString" connectionString="Data Source=machinename\instancename;Initial Catalog=AdventureWorks;Integrated Security=SSPI;Min Pool Size=5;Max Pool Size=60;Connect Timeout=30″ providerName="System.Data.SqlClient"/>

</connectionStrings>



6) Make sure your login account has access permission on the database you used during login.

Alternative:
If you still can’t get any connection, you may want to create a SQL account on the server, a corresponding SQL user on the database in question, and just use this username/password login data to connect to SQL Server.



7) Check that you have connectivity to the SQL Server.

Note what you are using to connect: machine name, domain name or IP address? Use this when checking connectivity. For example if you are using myserver
• Start > Run > cmd
•netstat -ano| findstr 1433
•telnet myserver 1433
•ping -a myserver


Check what ports are IP addresses are being returned.

If you still can’t get any connection, you may want to create a SQL account on the server, a corresponding SQL user on the database in question, and just use this username/password combo in your web application.



References:

SSMS Error: "A network-related or instance-specific error occurred while establishing a connection to SQL Server"

Configure the Windows Firewall to Allow SQL Server Access

How to: Enable the TCP/IP Protocol for a Database Instance

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

Resolve SQL Server connectivity issues - Microsoft SQL Server - Site Home - TechNet Blogs

Attachments

    Outcomes