无法连接到本地sql实例

发布于 2024-12-11 05:02:43 字数 561 浏览 0 评论 0原文

我正在尝试连接到本地 sql server 2008 实例。我正在使用 SQL Server Management Studio 2008 R2。 logindetails:

servername: .\SQLEXPRESS
authentication: Windows Authentication
username:myuser

也许有趣的细节:当我在 sql server 配置管理器中查看 sql server services 时,什么也没有?

错误信息:

标题:连接到服务器

无法连接到 mymachinename\SQLEXPRESS。

其他信息:

发生网络相关或特定于实例的错误 建立与 SQL Server 的连接。找不到服务器或 无法访问。验证实例名称是否正确 SQL Server 配置为允许远程连接。 (提供者:SQL 网络接口,错误:26 - 定位服务器/实例时出错 指定)(Microsoft SQL Server,错误:-1)

I am trying to connect to my local sql server 2008 instance. I am using sql server management studio 2008 R2. logindetails:

servername: .\SQLEXPRESS
authentication: Windows Authentication
username:myuser

Interesting detail maybe: when I look in the sql server configurationmanager, under sql server services , there is nothing?

Error message:

TITLE: Connect to Server

Cannot connect to mymachinename\SQLEXPRESS.

ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred 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: 26 - Error Locating Server/Instance
Specified) (Microsoft SQL Server, Error: -1)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

回忆躺在深渊里 2024-12-18 05:02:43

您可能需要以管理员身份运行 SQL Server 配置管理器才能查看服务。不知道为什么你看到“什么也没有”。你所说的“什么都没有”到底是什么意思?

以下是您需要查找的事项清单:

  • SQL Server Express(在您的情况下)是一个命名实例。因此,您需要确保SQL Server Browser 服务已启动。您可以通过 SQL Server 配置管理器 (SSCM) 来执行此操作。需要为命名实例启动此服务的原因是,当尝试建立连接时,这是通过端口 1434 命中的内容。命名实例使用随机端口(而默认实例是固定端口,默认为 1433)
  • 如果您尝试远程访问此实例,则需要通过 SSCM 并确保 TCP/IP。默认情况下,SQL Server Express 仅启用共享内存协议,因为它在本地应用程序中经常使用
  • 确保您可以 ping 实际计算机(如果不是本地机器)以排除网络问题

You may need to run SQL Server Configuration Manager as an administrator to see the services. Not sure why you see "nothing". What exactly do you mean by "nothing"?

Here's the checklist of things you need to look for:

  • SQL Server Express (in your case) is a named instance. Because of this you need to ensure that the SQL Server Browser service is started. You can do this through SQL Server Configuration Manager (SSCM). The reason this service needs to be started for named instances is that this is what is hit through port 1434 when a connection is trying to be made. Named instances use random ports (whereas the default instance is a set port, 1433 by default)
  • If you are trying to hit this instance remotedly, you need to go through SSCM and ensure that the enabled protocols in TCP/IP. By default, SQL Server Express enabled only Shared Memory protocol, as it is used often in local applications
  • Make sure you can ping the actual machine (if it is not the local box) to rule out network issues
沉默的熊 2024-12-18 05:02:43

我有同样的问题。我打开我的电脑管理-->服务屏幕,发现 SQL Server 和 SQL Server 代理没有运行。我尝试启动它们,但收到一条消息,指出由于登录失败,它们无法启动。

我打开它们(属性)更改了登录ID和密码(我的最近更新了),然后启动了服务。打开 SQL 并尝试使用 Windows 身份验证登录 - 非常有效。 基本上,这些服务需要运行。

或者,我相信 SQL 配置管理器会在“服务”面板中向您指出相同的内容。

如果您仍然无法登录,还可以尝试使用 localhost 与 local 作为实例名称。

希望这有帮助!

I had the same issue. I opened up my computer Managerment --> services screen and saw that SQl Server and SQL Server Agent were not running. I tried starting them and got a message that they could not be started due to a logon failure.

I opened them up(properties) changed the login id and password(mine had been updated recently) and then started the services. Opened up SQL and tried loggin in with windows authentication - worked like a charm. Basically, those services needed to be running.

Alternatively, I believe SQL configuration manager will point you to the same thing within the Services panel.

also try localhost vs local as the instance name if you are still unable to login.

Hope this helps!

時窥 2024-12-18 05:02:43

确保您的 SQL Server 实例名为 SQLEXPRESS。您可以快速查看 Sql Server 配置管理器中运行的服务器。通常,当 Management Studio 找不到服务器实例时,您会收到此错误。

让我们知道您的进展如何!

Ensure that your SQL Server instance is called SQLEXPRESS. You can have a quick look at the servers running in the Sql Server Configuration Manager. Usually you get this error when Management Studio can't find the Server instance.

Let us know how you get on!

深爱成瘾 2024-12-18 05:02:43

我最终再次安装了 sql server,现在它可以工作了!

I ended up installing sql server again and now it works!

无风消散 2024-12-18 05:02:43

可能是您尝试通过 SSMS 访问 SQL Server 时没有运行 SQL Server 实例

May be you didn't have a SQL Server instance running from where you were trying to access SQL Server via SSMS

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文