Monday, 28 January 2008

User is not associated with a trusted SQL Server connection

Login failed for user 'username'. The user is not associated with a trusted SQL Server connection.

This error had me scratching my head today for around 30 mins (mainly because I rarely setup SQL Server instances from scratch), and took me just 30 secs to fix.

Basically the SQL server instance you are conecting to has been configured to operate in Windows Authentication Mode and doesn't allow the use of SQL accounts. So change the Authentication Mode of the SQL server from Windows Authentication Mode to Mixed Mode (Windows Authentication and SQL Server Authentication). To do this right click your SQL Server instance in Enterprise Manager/Management Studio, select security and you should see the option in there. Hope you didn't waste as much time as I did on this :)


Kicker said...

I have the same problem, but in my case, changing to Mixed Mode authentication did not fix the problem.

I can login under Windows Authentication without problem, but any attempt to use SQL Server Authentication results in the "not associated" error.

I have also tried using the "sa" account, changing "sa" passwords, and even dropping password policy on the "sa" account... no joy.

Any suggestions?

Anonymous said...

Did you restart the sql service after changing it to mixed authentication?

Neil kilbride said...

Sounds to me like you need to kick the service, or even re-boot the machine.

Anonymous said...

Neil, Thanks for the tip... I was getting frustrated!

Anonymous said...

thanks for the solution, it was EXACTLY what i needed!

It was actually a little different in Management Studio: rt click on db instance / properties / security in the left panel / Server Authentication / "SQL Server and Windows Authentication mode"

Thanks again!

Anonymous said...

I have the same problem, but in my case, changing to Mixed Mode authentication ,It fixed the problem.

-- krishna

Ian Dykes said...

Well, look what we have here! Searched for "The user is not associated with a trusted SQL Server connection." and 4th result leads here.

Helped as well, which is the main thing :)

Neil kilbride said...

Ha. Always nice to help an old friend. I get a hell of alot of hits for this blog entry!

gfutfy said...

You said you will love me wow gold the whole life, but you marry her. You said Cheap WoW Gold you will wow power leveling,come to marry me, but this will not be carried out forever.WoW Gold I am trying my best to forget you and do not love you anymore. wow leveling But I failed and I still love you. Maybe wow leveling she needs you more compared wow leveling with me. So I tell you that world of warcraft power leveling you should love world of warcraft power leveling her and take good world of warcraft leveling care of her. You said I was so of warcraft leveling Yes, because I love you,world of warcraft leveling I hope you will be power leveling happy forever.

Danny said...

What if you using SQL Express with Visual Studio and you have no Enterprise Manager? I installed SQL Server Management Studio Express and everything looks right, but still no success.

Anonymous said...