SQL Server 2008 can't login with newly created user

Sql ServerAuthenticationLoginSsms

Sql Server Problem Overview


I'm using using Windows Vista and I'm having trouble logging in with a newly created user.

  1. I open SQL Server Management Studio.
  2. I create a new Login by right-clicking on Security->Logins.
    Check: SQL Server Authentication
    Login name: tester
    Password: test
    Click OK
  3. I added this user to User Mapping to my database of choice.
  4. Click File -> Connect Object Explorer, select SQL Server Authentication and enter tester/test and click Connect.

I get an error:

Login failed for user 'tester'. (Microsoft SQL Server, Error: 18456" 
with Severity = 14 and State = 1.

What causes this error and how do I login with my user?

Sql Server Solutions


Solution 1 - Sql Server

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, click on Properties

  2. Select Security from the left pane.

  3. Select the SQL Server and Windows Authentication mode radio button, and click OK.

    enter image description here

  4. Right-click on the SQL Server instance, select Restart (alternatively, open up Services and restart the SQL Server service).

This is also incredibly helpful for IBM Connections users, my wizards were not able to connect until I fxed this setting.

Solution 2 - Sql Server

If you haven't restarted your SQL database Server after you make login changes, then make sure you do that. Start->Programs->Microsoft SQL Server -> Configuration tools -> SQL Server configuration manager -> Restart Server.

It looks like you only added the user to the server. You need to add them to the database too. Either open the database/Security/User/Add New User or open the server/Security/Logins/Properties/User Mapping.

Solution 3 - Sql Server

You'll likely need to check the SQL Server error logs to determine the actual state (it's not reported to the client for security reasons.) See here for details.

Solution 4 - Sql Server

Login to Server as Admin

Go To Security > Logins > New Login

Step 1:

Login Name : SomeName

Step 2:

Select  SQL Server / Windows Authentication.

More Info on, https://stackoverflow.com/questions/750303/what-is-the-differences-between-sql-server-authentication-and-windows-authentica

Choose Default DB and Language of your choice

Click OK

Try to connect with the New User Credentials, It will prompt you to change the password. Change and login

OR

Try with query :

USE [master] -- Default DB
GO

CREATE LOGIN [Username] WITH PASSWORD=N'123456', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=ON, CHECK_POLICY=ON
GO

--123456 is the Password And Username is Login User 
ALTER LOGIN [Username] enable -- Enable or to Disable User
GO

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTravis HesemanView Question on Stackoverflow
Solution 1 - Sql ServerTravis HesemanView Answer on Stackoverflow
Solution 2 - Sql ServerJoe MayoView Answer on Stackoverflow
Solution 3 - Sql ServerGuyBehindtheGuyView Answer on Stackoverflow
Solution 4 - Sql ServerMAXView Answer on Stackoverflow