6

I'm trying to create a user in a SQL Server database with SQL authentication. That's what I did:

  1. Created database named testDb (with default parameters)
  2. ran script

    CREATE LOGIN test 
        WITH PASSWORD = 'test';
    USE testDb;
    CREATE USER test FOR LOGIN test;
    GO 
    
  3. Ensured user test appeared in Databases\testDb\Security (in Management Studio)

  4. Tried to connect to the server with Management Studio using user test
  5. Got 18456 error.

I'm using SQL Server 2008 Developer Edition. The OS is Windows 7 Ultimate. What am I doing wrong?

4
  • I don't see anything that you're doing wrong - this should work just fine (and did on my machine just now)..... did you mistype the password by any chance?? ..... Commented Oct 9, 2011 at 8:08
  • no way. I tried many times (even in notepad). Might anything be wrong with server settings? Commented Oct 9, 2011 at 9:02
  • 1
    Have you configured the instance to allow mixed mode authentication and then restarted it? By default SQL Server logins are disabled. Commented Oct 9, 2011 at 9:21
  • No, I set up with default settings. It there a way to change it now? How? Commented Oct 9, 2011 at 9:57

1 Answer 1

7

By default SQL Server logins are disabled.

You need to right click the instance in SSMS object Explorer then from the "Properties" dialogue, Security Tab enable "SQL Server and Windows Authentication mode".

This requires a restart of the SQL Server service to take effect,

Sign up to request clarification or add additional context in comments.

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.