[fix]-Cannot connect to local SQL Server

Wikitechy | 761 Views | sql server | 09 Jun 2016

 

Scenario:

The machine has SQL Server Express installed. SQL Server services for SQL Server (SQLEXPRESS), SQL Server browser, also the DTC service are in started state. But error occurs when connecting to SQL Server Management Studio (locally).

TITLE: Connect to Server

Cannot connect to (local).

ADDITIONAL INFORMATION:

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

Error:

Cannot connect to local SQL Server

Fix 1:

With Windows 10:

Go to Control Panel -> Administrative Tools -> Services.

Scroll down and find SQL Server (SQLEXPRESS), and right-click on it.

Select “Start” from the popup window that shows up.

Fix 2:

For connecting to the local express instanceuse the server connection as .\SQLEXPRESS.

Fix 3:

Ensure that TCP/IP protocol is enabled in SQL Network Configurations. Also set the TCP Port to 1433 as shown below:

 

Fix 4:

Use the server name as: (local)\SQLEXPRESS or localhost\SQLEXPRESS.

Fixes are applicable to the following versions of SQL Server:

  • SQL Server 1.1 (16 bit)
  • SQL Server 4.2A (16 bit)
  • SQL Server 4.2B (16 bit)
  • SQL Server 4.21a
  • SQL Server 6.0
  • SQL Server 6.5
  • SQL Server 7.0
  • SQL Server 7.0 OLAP Tools
  • SQL Server 2000
  • SQL Server 2000 64-bit Edition
  • SQL Server 2005
  • SQL Server 2008
  • Azure SQL DB
  • SQL Server 2008 R2
  • SQL Server 2012
  • SQL Server 2014
  • SQL Server 2016

Related Error Tags:

  • SQL Server 2008 R2 can't connect to local database in Management
  • Cannot connect to local SQL Server with Management Studio
  • I cannot connect to my local SQL Server 2008?
  • Why can't I connect to my local SQL Server database instance? 
  • sql server 2008 r2 - Cannot connect to my local instance
  • How to Troubleshoot Connecting to the SQL Server Database Engine
  • authentication - Connecting to a local SQL Server instance fails
  • SQL Server 2008 R2 can't connect to local database in Management studio




Workshop

Bug Bounty
IOT Hackathon
Webinar

Join our Community

Advertise