开发者

Cannot create sql server database user correctly

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?


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,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜