107

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)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
ksg
  • 3,927
  • 7
  • 51
  • 97
  • 1
    Possible duplicate of [SQL Server 2008 can't login with newly created user](http://stackoverflow.com/questions/1719399/sql-server-2008-cant-login-with-newly-created-user) – bob esponja Feb 17 '17 at 08:37

3 Answers3

179

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.
Vijay Nirmal
  • 5,239
  • 4
  • 26
  • 59
NG.
  • 5,695
  • 2
  • 19
  • 30
164

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"
stb
  • 3,405
  • 2
  • 17
  • 24
  • 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... – ksg Jul 24 '12 at 07:42
  • You pointed to actual error that is Mixed mode needs to be on and that saved my hours... Thank you... – Jenish Rabadiya Mar 02 '18 at 09:48
  • Here is a step by step guide: https://help.blacknight.com/hc/en-us/articles/212511129-Set-MS-SQL-to-mixed-mode-Authentication-on-Windows-Cloud-VM – Pouya BCD Nov 13 '18 at 14:37
  • 7
    This requires the service to be restarted after committing the changes. – Chris Cruz Jun 20 '19 at 17:44
  • Yep, go into the services app and restart the sql server service – Nick Turner Sep 07 '21 at 14:52
36

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.

Halis Yılboğa
  • 850
  • 10
  • 12