Q: Connecting to a local SQL Server instance fails with an error I have installed MS SQL Server 2008 R2 with authentication mode but when now when I click to the connect I gives such kind of error:

A network-related or instance-specific error occurred while establishing a connection to SQL server. The server was not found or not accessible. Verify that the instance name is correct.


A: You haven't mentioned what authentication method you have selected when installing SQL Server. I'm assuming it was Windows authentication. Make sure you're authenticating with a correct account (the one you've choosen when installing SQL Server). If you have changed your mind and want to use another account to connect to your server, you can do it by starting the installer again and choosing to perform maintenance on existing instance of the server.
Check your server name. These are example values that let me connect to my local server, assuming my computer name is GRON, I'm using Windows auth and my username is gronostaj: (it's SQL Server 2012 but it doesn't matter)

Third thing to check is if your server is actually running. Check if the SQL Server service is enabled and running:


*

*Press Win+R and type services.msc, press Enter

*Find SQL Server (MSSQLSERVER) in the list, double click it.

*Make sure Startup type is Automatic or Manual (Automatic means that server will start with Windows, with Manual you'll have to start it by hand).

*In the same window check Service status, it should be Started. If it's not, click Start and wait until a progress window disappears. Service status should change to Started.


This is how the service configuration window looks like when you want to start the server manually and it's already up and running:

Now you should be able to connect to the server using settings mentioned above. If it still doesn't work, you can try to verify if the server is running on the expected port 1433.


*

*Press Win+R again, type cmd and confirm with Enter. A command line will appear.

*Type telnet localhost 1433, press Enter.

*If you can see a message Connecting To localhost... then the server is running on a non-default port. If it flashes briefly, followed by a blank console window then the server is running and awaiting connections, you should recheck your authentication data and server name.

