SqlServer教程

Trouble Connecting to sql server Login failed. "The login is from an untrusted domain and canno

本文主要是介绍Trouble Connecting to sql server Login failed. "The login is from an untrusted domain and canno,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

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

回答1

Getting rid of Integrated Security=true worked for me.

 

回答2

If your SQL Server is on one domain controller and you are trying to connect to it from another domain controller then you will get this error when

IntegratedSecurity = true;

This will happen even if you include a valid SQL Server username and password in your connection string as they will automatically be over-written with your windows login and password. Integrated security means simply - use your windows credentials for login verification to SQL Server. So, if you are logged in to a different domain controller then it will fail. In the case where you are on two different domain controllers then you have no choice but to use

IntegratedSecurity = false;

Now, when Integrated security is false SQL Server will use the SQL Server login and password provided in your connection string. For this to work, the SQL Server instance has to have its authentication mode configured to mixed mode, being, SQL Server and Windows Authentication mode.

To verify or change this setting in SQL Server you can open the SQL Server Management Studio and right-click on your server name and then select Properties. On the pop-up that appears select Security and you will see where to alter this setting if you need to.

 

这篇关于Trouble Connecting to sql server Login failed. "The login is from an untrusted domain and canno的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!