SQL Error: Login Failed for User – What to do?

By | 2. 2. 2020

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 - (1 vote)
Category: SQL Administration Tags:

About Jan Zedníček

My name is Jan Zedníček and I work as a freelancer. I have been working as a freelancer for many companies for more than 5 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 and I enjoy tasting of best quality rums. I am trying to summarize all my knowledge on this website not to forget them (because of the rum effect, you know =) and to put them forward to anyone. Don´t worry about asking for help or writing some comments.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.