115

My problem is I cannot login into SQL Server after I've created a user. The user creation is successful, since the new user is listed under security/logins.

How to solve this issue ???

Login failed for user 'sims'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

1

3 Answers 3

206

SQL Server was not configured to allow mixed authentication. Here are steps to fix:

  1. Right-click on SQL Server instance at root of Object Explorer,
  2. click on Properties.
  3. Select Security from the left pane.
  4. Select the SQL Server and Windows Authentication mode radio button, and
  5. click OK.
  6. Open up Services and restart the SQL Service (SQLEXPRESS) Windows service.
Sign up to request clarification or add additional context in comments.

8 Comments

+1 for restarting the services. the only bit was missing before it worked... you saved from suicide... !
@Maxim in the Management Studio - it's the left column (pane)
That's the right answer, you need to restart the service (not the job)
Yep, just closing and re-opening SSMS does NOT fix the issue. This should be accepted answer IMO as well
Thanks. Looks like I'm not the only one who almost gave up and took a bullet before going stackoverflow.
|
174

Try setting your authentication mode to mixed mode. Your server does probably not accept logins using sql server accounts.

  1. Open properties
  2. Go to "Security"
  3. Select "SQL Server and Windows Authentication mode"

5 Comments

Thankyou very much for your wonderful answer.It works correctly.I've no more doubt how to give permission to a user to access only particular database...
You pointed to actual error that is Mixed mode needs to be on and that saved my hours... Thank you...
Here is a step by step guide: help.blacknight.com/hc/en-us/articles/…
This requires the service to be restarted after committing the changes.
Yep, go into the services app and restart the sql server service
41

basically : Right click Server for properties...

enter image description hereproperties

for detailed explanation: If you're encountering the "Login failed for user" error when trying to log in to SQL Server after creating a new user, you can follow these steps to resolve the issue:

Change Authentication Mode:

Right-click on the SQL Server instance and select "Properties." In the Properties window, navigate to the "Security" section. Choose the "SQL Server and Windows Authentication mode" option. Click "OK" to save the changes.

Restart SQL Service:

  • Open the SQL Server Configuration Manager.
  • Locate the SQL Server service (e.g., SQLEXPRESS) and restart it.

Additional Troubleshooting Steps:

  • If the issue persists, make sure the user is associated with the correct database and has appropriate permissions.
  • Double-check the connection string in your application to ensure it specifies the correct authentication mode and user credentials.

Remember to back up your SQL Server settings before making any changes.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.