Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot connect to SQL Server Management Studio

tearing my hair out to be honest at this stage.

I have an installation of SQL Server 2008 express on my laptop. I've been trying to login to SQL Server Management Studio without success. I even did a fresh install yesterday and still no joy. On installation I selected to install the default instance with windows authentication, I have enabled remote connection in configuration manager.

The error message I get when I log in is as following:

A network related or instance specific error occured 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: SQL Network Interfaces, error: 25 - connection string is not valid)(Microsoft SQL Server, Error:87)

I've tried googling it and all I can see is help for people who get error 26 (which I was getting before I did the fresh install.

The settings for login are:

Server Type: Database Engine Server Name: TARAW-PC\MSSQLSERVER Authentication: Windows Authentication

like image 299
109221793 Avatar asked Dec 07 '22 01:12

109221793


2 Answers

Try to give only your machine name. Like if it is Your machine name/serverInstance so simply give it only your machine name then try to login.


Explanation why this trick works: here Microsoft writes

An instance is either the default instance or a named instance. The default instance name is MSSQLSERVER. It does not require a client to specify the name of the instance to make a connection.

So if you created default instance (MSSQLSERVER) or named instance with name MSSQLSERVER you then should not add the instance name but just use the server's name (your machine name).

like image 132
user2536341 Avatar answered Jan 05 '23 13:01

user2536341


Can you check if your sql services are running.

In your start -> Run, type net start mssqlserver

Then try the login

like image 33
Sachin Shanbhag Avatar answered Jan 05 '23 14:01

Sachin Shanbhag