Can't login to sql server with new user

I created a login named logintest (SQL Authentication) after which I created a user named usertest with this login

user creation is successful and I changed the mixed mode authentication mode and also restarted the SQLSERVERAGENT and MSSQLSERVER services

and this error appears when I try to login with the created user

Unable to connect to SARAH.

Login failed for user 'usertest'. (Microsoft SQL Server Error: 18456)

+3


source to share


1 answer


The entrance must contain CONNECT

.
The entrance must be enabled.
The default database associated with the login must be the database the login has permission to connect to (for example, by default, master

the database grants permission to the user guest

to connect).

USE [master]
GO
ALTER LOGIN [logintest] WITH DEFAULT_DATABASE=[master]
GO
GRANT CONNECT SQL TO [logintest]
GO
ALTER LOGIN [logintest] ENABLE
GO

      



Then make sure the password is correct and that the guest

user is included in the database master

.

0


source







All Articles