Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2008 R2 can't connect to local database in Management Studio

I am using SQL Server 2008 R2 Express.

I first installed SQL Server 2008 R2 Express Management Studio and then I installed SQL Server 2008 R2 Express. I have the instance SQLEXPRESS running and it is set to automatic.

I am trying to connect to it locally using Windows authentication - server name is set to local and the username is grayed out and set to my profile username.

When I try to connect I get the following error:

enter image description here

Have I installed the wrong SQL Server Management Studio?

like image 958
jn025 Avatar asked Feb 16 '14 08:02

jn025


People also ask

Why SSMS is not connecting to SQL Server?

Check to see if allow remote connections for this server is enabled. In SSMS, right click on the instance name and select Properties. Go to the Connections tab and make sure Allow remote connections to this server is checked. If you need to make a change, you must restart the SQL Server instance to apply the change.


2 Answers

If your instance is called SQLEXPRESS, then you need to use .\SQLEXPRESS or (local)\SQLEXPRESS or yourMachineName\SQLEXPRESS as your server name - if you have a named instance, you need to specify that name of the instance in your server name.

like image 95
marc_s Avatar answered Sep 21 '22 15:09

marc_s


Your "SQL Server Browser" service has to be started too.

Browse to Computer Management > Services. how to browse to computer management

Find find "SQL Server Browser"

  1. set it to Automatic
  2. and also Manually start it (2)

how to edit sql server browser properties and start it

Hope it helps.

like image 30
Kenan Zahirovic Avatar answered Sep 19 '22 15:09

Kenan Zahirovic