Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

后端 未结 9 1370
北海茫月
北海茫月 2020-11-29 04:23

I been strugling with this for 2 days now without comming any closer to solution. I have read 20-30 threads alteast and stil can not resolve this.

Please help me out

9条回答
  •  有刺的猬
    2020-11-29 05:08

    You said it worked fine when you were using SQL Express edition. By default express editions create a named instance & run in NT Authority\Network Service.

    SQL Server STD by default install a default instance & run in NT Authority\SYSTEM.

    Do you have both the full SQL edition & Express edition installed on the same machine?

    1. It could be that somewhere the connection string still refers to the Named instance 'SQLEXPRESS' rather than the default instance created by the full version.

    2. Also where is the connection string defined? In IIS or your code? Make sure that if defined in many places, all point to same SQL instance & database.

    3. Also try looking at the detailed error present in the SQL Server error logs. The error logged in event log are not complete for secuirty reasons. This will also help you to know if the connection was made to the correct SQL Server.

    4. Also make sure that the machine on which SQL is installed is accessible & IIS is trying to access the same machine. In my company sometimes due to wrong name resolution, the query fails since most of our computers have SQL installed & the query lands in the wrong SQL Server.

    5. Make sure that the database exists in the SQL Server. The name displayed under databases in SQL Management Studio should match that in the connection string.

提交回复
热议问题