109221793
109221793

Reputation: 16867

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

Upvotes: 5

Views: 33235

Answers (6)

stackoverflowuser
stackoverflowuser

Reputation: 55

I know this one is pretty old but I had the same issue today and fixed it by myself. The issue was an IP setting in the Sql Server Configuration Manager See here

I had an IPv4 in the IP-Addess field and changing it to an IPv6 made it work.

Upvotes: 0

Patrick
Patrick

Reputation: 1

You will also see this error if you prefix the instance name with double blackslashes, eg. attempt to connect to \host\sqlserver instead of host\sqlserver - an easy mistake to make if you're used to typing UNC paths.

Upvotes: 0

AmiNadimi
AmiNadimi

Reputation: 5715

I had this problem and running net start mssqlserver also didn't work until i went to task manager > services and start the SQLSERVERAGENT service manually

Upvotes: 0

user2536341
user2536341

Reputation: 91

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).

Upvotes: 9

Termato
Termato

Reputation: 1610

If you are using Azure SQL Server, I would look at the following link: Guidelines for Connecting to Azure SQL Server I would try one of the following first to see if these two aren't your main issues:

  1. Specify the database you are connecting to. Options > Connect To Database. You will want to copy the name of the database here. This solved my issue.
  2. If you are putting the port after the URL of the SQL server. Example: dbname.database.windows.net:1433 (which makes you get this error). If I didn't have the port after the URL, it threw a login error issue.

After doing both of those and making sure everything else in the link I provided you is right or completed, you should be able to connect.

I hope this helps someone.

Upvotes: 2

Sachin Shanbhag
Sachin Shanbhag

Reputation: 55479

Can you check if your sql services are running.

In your start -> Run, type net start mssqlserver

Then try the login

Upvotes: 5

Related Questions