SQL Error Login failed for user <user name>. The user is not associated with a trusted SQL Server connection” is quite common. The problem is that SQL Server cannot identify user name. This is how the error message looks like.

Login failed for user

What are the Most Common Reasons?

  1. Incorrect login or authentication type (Windows vs. SQL)
  2. Login is not set up on SQL server (admin can solve this by creating an account and assessing rights)
  3. We are logging to SQL Server instance using SQL authentication which is not allowed on the server

Reasons 1,2 can be solved easily without more work. However, reason 3 can be a struggle.

SQL Server Authentication Methods

User can log to SQL Server in two ways

  1. SQL Authentication: login is on SQL Server set up manually. This will work if this type of login is allowed above SQL instance. Setting can be done (i) during SQL Server installation or (ii) in settings whenever after the installation (read further). User name and password is needed.
  2. Windows authentication : (set as default) is a second way. Here, we log in under our domain name (windows account). No name or password needed.

SQL Server Accepts Login Only Under Windows Auth Mode

Already mentioned error Login failed for user <user name>” SQL Server issues in case we try to log in using SQL login of type that is not allowed in settings. What to do about it?

1) Change can be done in settings (properties) of SQL instance

2) Go to section Security and mark SQL Server and Windows authentication mode selection

Did it help? Let me know in the comments if you still have troubles.

5/5 - (2 votes)

Ing. Jan Zedníček - Data Engineer & Controlling

My name is Jan Zedníček and I have been working as a freelancer for many companies for more than 10 years. I used to work as a financial controller, analyst and manager at many different companies in field of banking and manufacturing. When I am not at work, I like playing volleyball, chess, doing a workout in the gym.

🔥 If you found this article helpful, please share it or mention me on your website

Leave a Reply

Your email address will not be published. Required fields are marked *