SQL Server 2008 R2 can't connect to local data

2020-02-18 02:50发布

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?

9条回答
走好不送
2楼-- · 2020-02-18 03:23

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.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2020-02-18 03:28

I know, this problem can be faced by so many people and many of them have uninstalled and re-installed the sql server for resolving this issue. In my observation the problem of not connecting the database service locally is just because of your network connection you are using, in most of the cases these problems will come when you are using wi-fi network.

Solution is, if you are using wi-fi then just right click on status of the network and get the ip details and enter the same ip in sql server name, it will work. Regards Vishwajeet

查看更多
叛逆
4楼-- · 2020-02-18 03:32

I also received this error when the service stopped. Here's another path to start your service...

  1. Search for "Services" in you start menu like so and click on it:

enter image description here

  1. Find the service for the instance you need started and select it (shown below)
  2. Click start (shown below)

enter image description here

Note: As Kenan stated, if your services Startup Type is not set to Automatic, then you probably want to double click on the service and set it to Automatic.

查看更多
手持菜刀,她持情操
5楼-- · 2020-02-18 03:38

Follow these steps to connect with SQL Server 2008 r2 (windows authentication)

Step 1: Goto Control Panel --> Administrator Tools --> Services select SQL SERVER (MSSQLSERVER) and double click on it

Step 2: Click on start Service

Step 3: Now login to SQL server with Windows authentication and use user name : (local)

Enjoy ...

查看更多
再贱就再见
6楼-- · 2020-02-18 03:40

I had this problem. My solution is: change same password of other in windowns. Restart Service (check logon in tab Service SQL).

查看更多
家丑人穷心不美
7楼-- · 2020-02-18 03:46

I have the same error but with different case. Let me quote the solution from here:

Luckly I also have the same set up on my desktop. I have installed first default instance and then Sql Express. Everything is fine for me for several days. Then I tried connecting the way you trying, i.e with MachineName\MsSqlServer to default instance and I got exctaly the same error.

So the solution is when you trying to connect to default instance you don't need to provide instance name.(well this is something puzzled me, why it is failing when we are giving instance name when it is a default instance? Is it some bug, don't know)

Just try with - PC-NAME and everything will be fine. PC-NAME is the MSSQLServer instance.

Edit : Well after reading your question again I realized that you are not aware of the fact that MSSQLSERVER is the default instance of Sql Server. And for connecting to default instance (MSSQLSERVER) you don't need to provide the instance name in connection string. The "MachineName" is itself means "MachineName\MSSQLSERVER".

查看更多
登录 后发表回答