SQL Server 2005: Error: 18452 Login failed for user ‘username’. The 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 occurs when you attempt to login to SQL Server using SQL Server Authentication mode (username + password) when the SQL Server instance is only configured for Windows Authentication.

To fix the issue:

  1. Enable SQL Server Authentication
  2. Enable the “sa” user, and configure a password for it
  3. Restart the SQL Server Instance

1. Enabling SQL Server Authentication (or mixed authentication mode)

a) Open SQL Server Management Studio

b) Connect to the server using Windows Authentication

c) Right click the “Server” node in the tree (the top level node), and select properties

d) Select the Security page and select “SQL Server and Windows Authentication mode” as the “Server Authentication” value.

SQL Server Security Properties
SQL Server Security Properties

2. Enabling and setting the password for the ‘sa’ login

a) Run the following  SQL statements against the master DB:

ALTER LOGIN sa WITH PASSWORD = 'the password'
GO LOGIN sa ENABLE GO

OR

b) Expand the Security node in the SQL Server Management Studio and right click the “sa” user, and select “Properties”, and then on the “General” page provide a password, and on the “Status” page select “Enabled”.

Change the login properties for 'sa'
Change the login properties for 'sa'

3. Restart SQL Server Instance

Right click on the server node in the SQL Server Management Studio again, and select “Restart”. All the changes should now take effect.

6 thoughts on “SQL Server 2005: Error: 18452 Login failed for user ‘username’. The user is not associated with a trusted SQL Server connection.”

Leave a Reply

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