• Register
0 votes
45 views

The login is from an untrusted domain and cannot be used with Windows authentication.

Whenever I try to connect to a SQL server database, I get this error. Can you give me some advice?
1.9k points

Please log in or register to answer this question.

1 Answer

0 votes

The login is from an untrusted domain and cannot be used with Windows authentication.

 

It would help if you used Windows Authentication. One of the next things needs to be true:

1.       You execute from the same machine as the database server.

2.       You have an Active Directory environment. The user you execute the application under, and you have the right to connect to the database.

If the conditions above are not true, you need to:

1.       Establish a Windows Domain Controller, connect all the machines to the controller, fix SQL server to use domain accounts, or

2.       Change the SQL server to use both Windows and SQL Server accounts.

The easiest way is to change the SQL Server to use both Windows and SQL server accounts. Then you must create a SQL Server user on the database server and change your connection string.  The first option will take a day of installation and configuration. The second option takes about 5 minutes.

It is possible to have the connection string username and password overwritten with the Windows login and password. Integrated security means to use your Windows credentials for login verification to SQL Server. If you are logged in to another domain controller, then it will fail. You need to use:

IntegratedSecurity = false;

 Now, SQL Server will use the SQL Server login and password provided in your connection string. The SQL Server instance needs to have its authentication mode configured to mixed mode, the SQL Server and Windows Authentication mode. To check or change this SQL Server Management Studio setting and right-click on your server name and select Properties. On the pop-up, choose security, and you will see where you need to alter the setting if you need it.

3.4k points

Related questions

1 vote
1 answer 47 views
47 views
Problem : What am I missing > SQL Server Login failed: “The login is from an untrusted domain and cannot be used with Windows authentication”
asked Apr 26 Abik Dey 4k points
0 votes
1 answer 9 views
9 views
Problem: Please provide me guidance: owncloud you are accessing the server from an untrusted domain .
asked Jun 21 Diederich Raf 103k points
0 votes
1 answer 4 views
4 views
Problem: Is there a solution for this : Sql server management studio windows authentication different user?
asked Jun 19 asha 103k points
0 votes
1 answer 14 views
14 views
Problem: Please assist me in resolving this issue: With ....... statement names can be directly used. module name is not required
asked Mar 30 tuhin1 48.9k points
0 votes
1 answer 5 views
5 views
Problem: I'll make a submission for a response to my question. Please, I have searched the internet but have not found any useful material, and I am now having trouble continuing my studies.
asked Mar 29 tuhin1 48.9k points
0 votes
1 answer 88 views
88 views
Problem : I am very new to SQL.I and my colleague have recently joined SQL project now I have a table on my SQL Server and I want to export the structure of the table so that I can send it to my colleague. Which SQL command should one fire to get the required table structure? Please note that I don't have any access to the SQL Server Management Studio.
asked Jan 27, 2020 jwilliam 3.9k points
0 votes
1 answer 18 views
18 views
Problem: What is the solution? > Login failed for user sa microsoft sql server error 18456.
asked May 10 Junia Phoebe 83.8k points
0 votes
1 answer 105 views
105 views
Login failed for user nt authority system I receive the following error message in Logs: Login failed for user nt authority system. I need some advice.
asked Nov 3, 2020 miki 1.9k points
0 votes
1 answer 9 views
9 views
Problem : What is the best way for me to address this problem: The database principal owns a schema in the database and cannot be dropped?
asked Jun 16 Sifat55 90.2k points