The user is not associated with a trusted SQL server connection

Source: Internet
Author: User
Tags mssqlserver

 

     
The user is not associated with a trusted SQL Server Connection2009-05-06

Source: http://decipherinfosys.wordpress.com/2008/11/14/the-user-is-not-associated-with-a-trusted-sql-server-connection/

Support.microsoft.com/kb/889615

If you have worked with SQL Server for some time, you must have faced this error at some time or the other:

 

This error can come due to a couple of reasons. the most common reason is that the instance that you are trying to connect to has been set up as one with only Windows only authentication rather than Windows and SQL Server Authentication. you can check that easily by either by SSMs (SQL Server Management studio) or in the registry settings as well (in case you do not have the client tools loaded up on the instance where you are getting this error and you inherited this set up from someone ).

In SSMs, after you log in using your Windows authentication, right click on the server and choose "properties" and then go to the security page and change the "Server Authentication" to be "SQL Server and Windows Authentication Mode" as shown in the image below:

 

Once that is done, you will need to re-start the MSSQLServer service in order for the changes to take place.

The place where it gets stored in the registry is:

 

HKLM/software/Microsoft SQL Server/mssql.2005/MSSQLServer

Loginmode-if it is 1, then it is Windows mode and if it is 2, it is mixed mode (Windows and SQL Server ).

Now, other times you can also get this error with a blank user name I. e:

Login Failed for user". The user is not associated with a trusted SQL server connection

You can get that error in a couple of scenarios:

1)If the server name has a space after it's name, example: in the connection string you have specified: servername, 1433. e. that extra space after the servername (the Instance name ).
2)Not being able to resolve the Windows account that is trying to connect to the SQL server instance. Here are some scenarios that we have seen at client sites when this happens:

A)When using Windows authentication and the machine from where the connection is being made, instead of using a domain account, A local account on that machine is being used for making the connection to the SQL server instance. this is obviusly because the domain controller and SQL Server cannot recognize the local account on other machines.

B)In the case of Web applications, the account that runs IIS does not have access to SQL Server. you have to impersonate a domain user account in ASP. net for this. this KB article covers this in detail.

C)Another common reason is when communication is being made login SS domains which do not have a trust relationship set up between them.

D)We have also seen this in scenarios where because of heavy network load, communication between SQL Server and the domain controller is hindered.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.