SQL Server Login error: Login failed for user 'NT AUTHORITY\SYSTEM'

前端 未结 5 702
野性不改
野性不改 2020-11-29 01:39

I have created an application pool called \"schoolPool\" and assigned it to my web application. Identity for this pool has been set to LocalSystem. When I try to access my

相关标签:
5条回答
  • 2020-11-29 02:00

    There is another fix. You should open Command Prompt (cmd) and write the following:

    sqlcmd -S (server name)

    select name from sys.server_principals where name = 'NT AUTHORITY\SYSTEM'
    
    go
    
    SP_ADDSRVROLEMEMBER 'NT AUTHORITY\SYSTEM','SYSADMIN'
    
    go
    

    The first line will give you an access to the sql server on you machine, the second will take the following result NT AUTHORITY\SYSTEM an the stored procedure addsrvrolemember will add sysadmin to it. Be careful, because you have to type the following code the way it is.

    0 讨论(0)
  • 2020-11-29 02:01

    Rerun following query which will assign 'NT SERVICE\MSSQLSERVER' to sysadmin

    EXEC master..sp_addsrvrolemember @loginame = N'NT SERVICE\MSSQLSERVER', @rolename = N'sysadmin'
    
    0 讨论(0)
  • 2020-11-29 02:05

    Allow NT AUTHORITY/SYSTEM to server Role as sysadmin. enter image description here

    enter image description here

    0 讨论(0)
  • 2020-11-29 02:17

    Musakkhir's answer of granting sysadmin seems poorly thought out as far as security goes, and Pinal's answer involved giving the unknown process db_owner rights, still almost certainly overkill. I've 'solved' it myself by simply granting "public" rights, which normally just allows CONNECT, but nothing else, even SELECT. If gets rid of the login error and stops flooding the error log, since it now logs in, but whatever unknown process is doing the connecting still can't do anything.

    0 讨论(0)
  • I tweaked the application settings a lot, changing the application pool's identity (in Windows 8.1's IIS) to LocalSystem, LocalService, NetworkService, and ApplicationPoolIdentity. However, all of them failed to solve the problem I had logging into my database.
    Finally I set the pool identity on LocalSystem and thought why it might be preventing "NT AUTHRITY\SYSTEM" from opening a connection to my database. I opened up SQL Server Management Studio as "Administrator" and checked the Server Roles for NT AUTHORITY\SYSTEM under "logins" section. The default server role for this user was public by default. I also checked sysadmin and refreshed my web application form. This time it worked! Everything working perfectly now.

    0 讨论(0)
提交回复
热议问题