When I connect to my local server, I get this message

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)

This is my login information:

Server type :       Database Engine
Server name :       .
Authentication:     SQL Server Authentication
Login:              sa
Password:           123

How can I fix it?

  • Is the SQL service started and in a running state? Also, are you connecting to a default or named instance? – StanleyJohns Jul 30 '13 at 4:41
  • Are you able to connect to the server from any client? Can you connect directly from the server itself? If not, is the service in fact running? – Ali Razeghi Jul 30 '13 at 4:42
  • @StanleyJohns .. Yes , SQL service started and is in a running state , I'm connecting to a default instance ! – zey Jul 30 '13 at 4:43
  • @AliRazeghi , I can't connect directly from the server itself . I haven't connect from client yet ! – zey Jul 30 '13 at 4:47
  • 2
    Zey I was asking if you could RDP to the server and try to connect to SQL Server directly there. Normally this is horrible practice as it eats up RAM and so fourth, but for troubleshooting over a internet forum; it'll have to do. If you can, then you know services are running. Next thing to check is the fierwall and also ping. If it is NOT a named instance, you can TELNET <server IP> 1433. If the port was hardcoded or it is a named instance, then we have to find the port # first. If it opens to a blank screen your network is fine, if it doesn't, then something is blocking it in between. – Ali Razeghi Jul 30 '13 at 4:55

Go to SQL Server Configuration Manager

Start->all program->SQL Server 2008 R2->Configuration Tools->SQL Server Configuration Manager

Explore "SQL Server Network Configuration" and then select "Protocols For MSSQLSERVER".

Check your TCP/IP Protocols in right side pane. If it is disabled then enabled it and Restart the "Sql Server(MSSQLSERVER) service" that available in "SQL Server 2008 R2 services pane".

You can follow the same steps to make sure for other protocols and services.


Are you sure about your installation is successful?.If yes, then ckeck whether your server is

  1. configured for remote access

  2. exception in firewall

  3. check all protocols whether they are enabled or not accoding to your requirement.

  4. whether the instance is started or not.


Click on Start-> Search for "services.msc" hit Enter. Now you will see all the services which are running on your Computer.

Start the service : 1. SQL Server (MSSQLSERVER)

Then connect to local by providing server name : (local)

  • The asker previously verified that the service was already running so this won't help. – Colin 't Hart Mar 4 '17 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.