Trouble Connecting to sql server Login failed. “The login is from an untrusted domain and cannot be used with Windows authentication”

前端 未结 19 2799
闹比i
闹比i 2020-12-05 12:38

I am trying to host a SQL server database, but whenever I try to connect to it I get this error:

The login is from an untrusted domain and cannot be u

19条回答
  •  不知归路
    2020-12-05 13:17

    Following worked for me to get access from another machine to SQL Server using Windows Authentication. This approach may be useful only in development/test environment. E.g. you need to update password manually once you change it on your working machine.

    On machine with SQL Server go to Control Panel and add new Windows User with same username and password as is on your working machine. Then create SQL Server login for this user:

    CREATE LOGIN [SQLSERVERHOST\myuser] FROM WINDOWS;
    

    Now you can use this login for Windows Authentication.

    If you receive error 'The login is from an untrusted domain', this may mean that you changed password on your working machine and now need to update password on SQL Server machine.

提交回复
热议问题