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

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


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

enter image description here


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.


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

EXEC master..sp_addsrvrolemember @loginame = N'NT SERVICE\MSSQLSERVER', @rolename = N'sysadmin'