Windows service - Login failed for user 'NT AUTHORITY\SYSTEM'

不问归期 提交于 2019-12-11 14:56:44

问题


I've created simple console log app which behaves a windows service.

I'm wondering why am I getting an error

Login failed for user 'NT AUTHORITY\SYSTEM'

if I change my connection string in a way to use some another user which I previously created on SQL Server.

Example of connection string:

<value>Data Source=DESKTOP-Z67;Initial Catalog=MyDb;Integrated Security=false;User ID=service;Password=test1234</value>

Event if I specified this connection string, I'm getting error

Login failed for user 'NT AUTHORITY\SYSTEM'

Why isn't there an error like

Login failed for user 'service'

because I'm using that specific user in the connection string..

PS: I know how to fix this, I can go to SQL Server and edit this user NT AUTHORITY\SYSTEM to system admin, but I'm wondering why my app is trying to connect with this user instead of my user from connection string...

Thanks guys

Cheers

来源:https://stackoverflow.com/questions/56220598/windows-service-login-failed-for-user-nt-authority-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!