SQL 无法连接到 pc-name\SQLEXPRESS

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15332418/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 14:11:43  来源:igfitidea点击:

cannot connect to pc-name\SQLEXPRESS

sqlsql-serverdatabasesql-server-2008database-design

提问by Waleed Ehsan

While trying to connect to SQL server 2005 standard edition through SQL Server Management Studio 2005 I get the following error:

在尝试通过 SQL Server Management Studio 2005 连接到 SQL Server 2005 标准版时,出现以下错误:

screen shoot of error is given bellow

下面给出了错误的屏幕截图

I put all my effort to solve this problem but there is no solution. On stack overflow in the following post link given:

我竭尽全力解决这个问题,但没有解决方案。关于以下帖子链接中的堆栈溢出:

How to connect to local instance of SQL Server 2008 Express

如何连接到 SQL Server 2008 Express 的本地实例

in one answer of this post I found this screen shootsolution of screen shoot

在这篇文章的一个答案中,我发现了这个屏幕截图截屏解决方案

when I see my connect to server dialog box I find the difference like

当我看到我的连接到服务器对话框时,我发现了不同之处

my connect to server dialog box

我的连接到服务器对话框

What is the problem?

问题是什么?

This SQL server runs on a single machine, not on a cluster or on a client server.

此 SQL 服务器在单台机器上运行,而不是在集群或客户端服务器上。

回答by

enter image description here

在此处输入图片说明

Go to services (services.msc) and restart the services in the image and then try to connect.

转到服务 (services.msc) 并重新启动映像中的服务,然后尝试连接。

回答by S. Mayol

If you have Microsoft Windows 10:

如果您有Microsoft Windows 10

  1. Type Control Panelon Cortanasearch bar (which is says by default 'Type here to search').
  2. Click on Administrative Tools
  3. Then click on Services
  4. Scroll down and look for: SQL Server (SQLEXPRESS), after that right click
  5. And then in the pop out windows click on Start
  1. Cortana搜索栏上键入控制面板(默认情况下为“在此处键入以进行搜索”)。
  2. 点击管理工具
  3. 然后点击服务
  4. 向下滚动并查找:SQL Server (SQLEXPRESS),然后右键单击
  5. 然后在弹出的窗口中点击开始

Now you should be able to connect to your pc-name\SQLEXPRESS

现在您应该能够连接到您的pc-name\SQLEXPRESS

回答by Luis Mata

Initialize the SQL Server Browser Service.

初始化 SQL Server 浏览器服务。

回答by UTKARSH

Follow these steps then you solve your problem 100%.

遵循这些步骤,您就可以 100% 地解决您的问题。

  1. When you get this error then close everything(Microsoft SQL Server Managment):
  1. 当您收到此错误时,请关闭所有内容(Microsoft SQL Server 管理):

error

错误

  1. Then open command prompt by pressing (window+ r) keys and type services.mscand click OK or press Enter key.

  2. And search **SQL Server (SQLEXPRESS) as I show in the image.

  1. 然后按 ( window+ r) 键打开命令提示符并键入services.msc并单击 OK 或按 Enter 键。

  2. 并搜索 **SQL Server (SQLEXPRESS),如图所示。

enter image description here

在此处输入图片说明

  1. Now see left upper side and click start.

  2. If you open Microsoft SQL Server Management then you not get any type error.

  1. 现在看到左上侧并单击开始。

  2. 如果您打开 Microsoft SQL Server 管理,则不会出现任何类型错误。

Enjoy!!!

享受!!!

回答by akshay shedwad

When you get this error.

当您收到此错误时。

Follow these steps then you solve your problem

请按照以下步骤解决您的问题

  1. Open command prompt by pressing (window + r) keys or Click on windows Button and Type Run then type services.mscand click OK or press Enter key.
  1. 按 (window + r) 键打开命令提示符或单击 windows 按钮并键入运行,然后键入services.msc并单击确定或按 Enter 键。

2.Find SQL Server (SQLEXPRESS).

2.查找SQL Server (SQLEXPRESS)

3.Now see left upper side and click start.

3.现在看到左上侧并单击开始。

4.If Service show error then right click on SQL Express and then click on Properties.

4.如果服务显示错误,则右键单击SQL Express,然后单击属性。

5.Then click on Logon Tab.

5.然后单击登录选项卡。

6.Enter Username and Password of Windows Authentication

6.输入Windows认证的用户名和密码

7.Then Start your Service

7.然后启动您的服务

8.Problem will be solve and run your query

8.问题将被解决并运行您的查询

回答by Ramanujam Allam

Use (LocalDB)\MSSQLLocalDB as the server name

使用 (LocalDB)\MSSQLLocalDB 作为服务器名称

回答by Lisa Hertweck

I'm Running Windows 10 and this worked for me:

我正在运行 Windows 10,这对我有用:

  1. Open services by searching in the toolbar for Services.
  2. Right click SQL Server (SQLEXPESS)
  3. Go To Properties - Log On
  4. Check Local System Account & Allow service to interact with desktop.
  5. Apply and restart service.
  6. I was then able to connect
  1. 通过在工具栏中搜索服务来打开服务。
  2. 右键单击 SQL Server (SQLEXPESS)
  3. 转到属性 - 登录
  4. 选中本地系统帐户并允许服务与桌面交互。
  5. 应用并重新启动服务。
  6. 然后我就可以连接了

回答by Helder José

I had this problem. So I put like this: PC-NAME\SQLSERVER Since the SQLSERVER the instance name that was set at installation.

我有这个问题。所以我这样写: PC-NAME\SQLSERVER 因为 SQLSERVER 是在安装时设置的实例名称。

Authentication: Windows Authentication

身份验证:Windows 身份验证

Connects !!!

连接!!!

回答by user2161455

try using IP instead of pc name. If the ip working, then it might be the name pipe is not enable. If it;s still not working then the login using windows might be disabled.

尝试使用 IP 而不是 pc 名称。如果ip正常工作,则可能是名称管道未启用。如果它仍然无法正常工作,则可能会禁用使用 Windows 的登录。

回答by ady

go to services and start the ones related to SQL

转到服务并启动与 SQL 相关的服务