SQL Server Management Studio: network-related or instance-specific error while establishing a connection to SQL server.
Here's a screenshot of the error:
Your screenshot shows you trying to connect to
localhost from SQL Server Management Studio. This means you are implicitly making the following assumptions:
A SQL Server is already installed on
The SQL Server instance is currently running (check this in SQL Server Configuration Manager under "SQL Server Services").
The SQL Server instance is the default instance, and so is accessible without specifying an instance name such as
localhost\SQLEXPRESS (open a command prompt and type
sqlcmd -L to list your instances).
The SQL Server instance accepts connections via named pipes or TCP port 1433 (check this in SQL Server Configuration Manager under "SQL Server Network Configuration").
Which one of these assumptions is not true? Fix that and you'll probably be able to connect.
I solved this issue by running the following command in an elevated command prompt as specified in this post.
net start mssqlserver
How to fix? Method 1
Go to the Services Console (Hit Win +R and type services.msc) and look for SQL Server (MSSQLSERVER. If it is not started, start the service.
You can also start the service by running
net start mssqlserverin an elevated command prompt.