【问题标题】:Cannot add an account to SQL Server 2012无法将帐户添加到 SQL Server 2012
【发布时间】:2013-11-01 19:54:55
【问题描述】:

背景:

我在 IIS 中有一个应用程序池 [ABCDEMO]。 appool 的标识是“NetworkService”。我正在尝试在 Windows SERVER 2012 上将 IIS APPPOOL\ABCDEMO 添加到我的 SQL SERVER 2012。

当我尝试添加到登录时,我收到以下错误。

===================================

Create failed for Login 'IIS APPPOOL\ABCDEMO'.  (Microsoft.SqlServer.Smo)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Login&LinkId=20476

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()
   at Microsoft.SqlServer.Management.SqlManagerUI.CreateLoginData.LoginPrototype.ApplyGeneralChanges(Server server)
   at Microsoft.SqlServer.Management.SqlManagerUI.CreateLogin.DoPreProcessExecution(RunType runType, ExecutionMode& executionResult)
   at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.DoPreProcessExecutionAndRunViews(RunType runType)
   at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.ExecuteForSql(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
   at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.Microsoft.SqlServer.Management.SqlMgmt.IExecutionAwareSqlControlCollection.PreProcessExecution(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.RunNow(RunType runType, Object sender)

===================================

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
   at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ExecuteNonQuery(StringCollection queries, Boolean includeDbContext)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImplFinish(StringCollection createQuery, ScriptingPreferences sp)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()

===================================

Windows NT user or group 'IIS APPPOOL\ABCDEMO' not found. Check the name again. (.Net SqlClient Data Provider)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.2100&EvtSrc=MSSQLServer&EvtID=15401&LinkId=20476

------------------------------
Server Name: USALVWCOQA10
Error Number: 15401
Severity: 16
State: 1
Line Number: 1


------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)

感谢任何帮助。

【问题讨论】:

  • 为什么需要添加这个账号?它有什么用?
  • 您不需要将应用程序池帐户添加到 SQL。如果有的话,您应该在 IIS 中为 App Pool 身份提供一个域级服务帐户,然后在 SQL 中利用该帐户。
  • 你真的有一个名为“IIS APPPOOL”的域吗?我认为我从未见过一个带有空格的域名。我怀疑 SQL Server 会不会对此感到满意。

标签: sql sql-server iis sql-server-2012


【解决方案1】:

IIS 盒子和 SQL 服务器是否在同一台物理机上?

如果是,并且您的应用程序池作为网络服务运行,您可以添加:

'NT AUTHORITY\网络服务'

如果它们在不同的机器上运行,那么 NETWORK SERVICE 用于对网络进行身份验证的帐户是服务器本身的域帐户,在这种情况下,您应该将 IIS 服务器的机器帐户添加到 SQL 服务器作为所以:

'域\IISSERVERNAME$'

显然,将您的域和 IIS 服务器的主机名替换为那里,但美元符号很重要。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-28
    相关资源
    最近更新 更多