SQL Server 2008 R2 首次登录

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

SQL Server 2008 R2 First Time Login

sqlsql-server-2008loginssms

提问by 109221793

I've just started work on a new computer in which I had to download all the software fresh.

我刚刚开始在一台新计算机上工作,我必须在其中下载所有新软件。

I've just download a copy of SQL Server 2008 R2, and I'm trying to connect to SQL Server Management Studio without success. I vaguely remember last time I installed this, it asked me to choose between windows, or sql server authentication, however this didn't happen for this installation.

我刚刚下载了 SQL Server 2008 R2 的副本,但我正在尝试连接到 SQL Server Management Studio,但没有成功。我依稀记得上次安装它时,它要求我在 Windows 或 sql server 身份验证之间进行选择,但是这次安装并没有发生这种情况。

If I try to login via Windows Authentication (where the username and password fields are greyed out, localhost as server name) it gives the following error:

如果我尝试通过 Windows 身份验证(其中用户名和密码字段为灰色,localhost 作为服务器名称)登录,则会出现以下错误:

"A Network-related or instance specific error occured 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)"

“建立与 SQL Server 的连接时发生与网络相关或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接。(提供者:Named管道提供程序,错误:40 - 无法打开与 SQL Server 的连接)(Microsoft SQL Server,错误:2)”

I have checked everything in SQL Server Configuration Manager, and everything bar VIA is enabled.

我已经检查了 SQL Server 配置管理器中的所有内容,并且启用了所有栏 VIA。

If I try SQL Server Authentication, It asks me for a username and password which I definiately have not set yet. Also, under SQL Server Services in configuration manager, there is nothing there.

如果我尝试 SQL Server 身份验证,它会要求我输入我尚未设置的用户名和密码。此外,在配置管理器中的 SQL Server 服务下,什么也没有。

Any help would be appreciated :)

任何帮助,将不胜感激 :)

Thanks

谢谢

PS: I don't know if it's worth mentioning but I am running Windows 7 as a virtual machine on a Mac.

PS:我不知道是否值得一提,但我在 Mac 上将 Windows 7 作为虚拟机运行。

采纳答案by 109221793

Ended up reinstalling completely and doing a fresh install from a fresh download. When I did this I was brought through the steps of selecting the default instance, and selecting authentication modes.

最终完全重新安装并从全新下载进行全新安装。当我这样做时,我完成了选择默认实例和选择身份验证模式的步骤。

Working fine now :)

现在工作正常:)

回答by Crippledsmurf

Are you sure you have the correct instance name? If it was SQL Server 2008 R2 Express Edition then the default instance name is .\SQLEXPRESS.

你确定你有正确的实例名称吗?如果是 SQL Server 2008 R2 Express Edition,则默认实例名称为 .\SQLEXPRESS。

Also if your using sql authentication to connect try running sql management studio as admin, if you are a limited user your identity might not be mapped to an account in sql server yet but i believe the Administrators user group is.

此外,如果您使用 sql 身份验证连接尝试以管理员身份运行 sql management studio,如果您是受限用户,您的身份可能尚未映射到 sql server 中的帐户,但我相信管理员用户组是。

回答by Sachin Shanbhag

You need to check if your services are running.

您需要检查您的服务是否正在运行。

Please type

请输入

net start mssqlserver

网络启动 mssqlserver

in your command prompt. Then try to login.

在您的命令提示符中。然后尝试登录。

回答by Paul

After checking tons of sites looking for an answer to this question, I think I have a simple solution.

在检查了大量网站寻找这个问题的答案之后,我想我有一个简单的解决方案。

  1. Open the sql Server Configuration
  2. Click on the sql server services node
  3. Right Click on Sql server
  4. Click Start.
  1. 打开sql Server配置
  2. 点击sql server服务节点
  3. 右键单击Sql服务器
  4. 单击开始。

I have been screwing around with this forever, and this simple method actually worked.

我一直在搞这个,这个简单的方法确实有效。