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:
- Created database named
testDb
(with default parameters) ran script
开发者_如何转开发CREATE LOGIN test WITH PASSWORD = 'test'; USE testDb; CREATE USER test FOR LOGIN test; GO
Ensured user
test
appeared inDatabases\testDb\Security
(in Management Studio)- Tried to connect to the server with Management Studio using user
test
- 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,
精彩评论