Join Us!

Spaces are allowed; punctuation is not allowed except for periods, hyphens, and underscores.
A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Login

Enter your Project Envision username.
Enter the password that accompanies your username.
Request new password

Sql Server Error: 18452 Login failed for user

This one of the most common errors you can find on Sql Server or ASP.NET forums is Error 18452 Login failed for user. There are three causes, which could trigger that error:

  1. User tried to login using Sql Server Authentication but server allows only for Windows Authentication
  2. User tried to login using Sql Server authentication, but the login does not exist in Sql Server
  3. User tried to login using Windows Authentication, but the login is unrecognized Windows Principal

Check authentication mode

To check the Authentication Mode of Sql Server, we can use xp_logininfo procedure or click Server Properties in Sql Server Management Studio.

exec  xp_loginconfig 'login mode'
login mode Mixed

To change the Authentication mode you can edit registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\InstanceNumber( i.e. MSSQL.1)\MSSQLServer\LoginMode with values 0 for Windows Authentication and 2 for Sql Server Authentication. After changing the registry key you have to restart Sql Server. Another way to perform that operation is by using Sql Server Management Studio, which is much easier and safer. Below screen shots illustrate that procedure.





Check if login exists on the Sql Server

To check we are trying to use exist in Sql Server we can query syslogins table.

Login exists
select count(*)
from master.dbo.syslogins
where loginname = 'wmuser'
1

Login does not exist
select count(*)
from master.dbo.syslogins
where loginname = 'xyz'
0

If you are using Windows Authentication

If you are using Windows Authentication you should check the things listed below

  • Verify that network connectivity between the server and the client works correctly. You can do it by pinging (ping command) the server from the client and the client from the server
  • Verify that name resolution works correctly:
    From the client: ping –a serverIP
    From the server ping –a clientIP
  • If the client machine, the server machine, and the account used to log on to the client are not all in the same domain, verify that the trusts between the domains are properly configured and working.
  • Verify that the Logonserver used by the client is a valid domain controller