如何启用默认Windows身份验证的登录?错误:18470

时间:2016-02-07 03:36:42

标签: sql-server windows-authentication

enter image description here

我尝试连接到默认或普通的Windows身份验证。禁用默认设置是我的错误,现在我无法访问它。请帮忙!

1 个答案:

答案 0 :(得分:0)

您无法同时禁用Windows和SQL身份验证(据我所知,您的某些帐户似乎已被禁用。如果您是管理员,这有一种方法可以帮助您添加新帐户管理员......

1.从sql service配置管理器中停止sql server服务
2.以单用户模式启动sql server

 Using configuration Manager 
    ◾Locate the service which you have stopped earlier. Go to its   
properties, “Advanced”, 
click on drop down at “Startup Parameters”  and add ;-mSQLCMD 

3.打开管理员命令提示符。 (即右键单击命令提示符快捷方式并选择“以管理员身份运行”

◦Typesqlcmd -S     例如
 ◾sqlcmd-S。 (默认情况下)
  ◾sqlcmd-S。\ MyInstance

4.现在在脚本下面运行

USE [master]
GO
CREATE LOGIN [BUILTIN\Administrators] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
GO
EXEC master..sp_addsrvrolemember @loginame = N’BUILTIN\Administrators’, @rolename = N’sysadmin’
GO

请注意,您应该成为内置管理员组的一部分,您可以通过在运行中键入lusrmgr.msc来添加它。

下面是博客文章FYR ......

http://sqlserver-help.com/2012/02/08/help-i-lost-sa-password-and-no-one-has-system-administrator-sysadmin-permission-what-should-i-do/