无法使用 Windows 身份验证登录 SQL Server

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16621754/
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 15:17:45  来源:igfitidea点击:

Can't login to SQL Server with Windows Authentication

sqlsql-serversql-server-2008

提问by Yassering

I've just installed SQL Server 2012 and open the SQL Server Management Studio and when I try to login this problem occurs:

我刚刚安装了 SQL Server 2012 并打开了 SQL Server Management Studio,当我尝试登录时出现此问题:

Can't connect to .....

无法连接到......

My question is how can I know what is the server name?

我的问题是我怎么知道服务器名称是什么?

And when I go to the SQL Server Configuration Manager I can't find the SQL Server services which should exist !!

当我转到 SQL Server 配置管理器时,我找不到应该存在的 SQL Server 服务!!

Any answer ?

任何答案?

Thanks.

谢谢。

回答by acdcjunior

If you installed SQL Express, the correct server name is:

如果您安装了 SQL Express,则正确的服务器名称是:

127.0.0.1\SQLEXPRESS

or

或者

YOURMACHINENAME\SQLEXPRESS

If that does not work there are some steps you can take:

如果这不起作用,您可以采取一些步骤:

Check if the "SQL Server Browser" windows service is activated and running:

检查“SQL Server Browser”Windows 服务是否已激活并正在运行

  • Go to Control Panel -> Administrative Tools -> Services
  • Open "SQL Server Browser" service and enable it (make it manual or automatic, depending on your needs)
  • Start it.
  • 进入控制面板 -> 管理工具 -> 服务
  • 打开“SQL Server Browser”服务并启用它(根据您的需要手动或自动)
  • 启动它。


If that too does not work, you can also check if the TCP/IP protocol is enabled in your SQL Server instance. Follow these steps (tested for SS2012) to make sure:


如果这也不起作用,您还可以检查是否在 SQL Server 实例中启用了 TCP/IP 协议。按照以下步骤(针对 SS2012 进行测试)以确保:

  • Open "Sql Server Configuration Manager" in "Start Menu\Programs\Microsoft SQL Server 2012\Configuration Tools\"
  • Expand "SQL Server Network Configuration"
  • Go in "Protocols for <YourInstance>"
  • Enable TCP/IP
  • 在“开始菜单\程序\Microsoft SQL Server 2012\配置工具\”中打开“ Sql Server 配置管理器
  • 展开“SQL Server 网络配置”
  • 进入“协议<YourInstance>
  • 启用 TCP/IP

If you have any problem, check this blog postfor details, as it contains screenshots and much more info.

如果您有任何问题,请查看此博客文章了解详细信息,因为它包含屏幕截图和更多信息。

That's it.

就是这样。