1

I have a database in SQL Server 2008 R2. I create a login in

SQL Object Explorer > Security > Logins > New > and ...

But, when I want login with aliadmin, I get an error :

Cannot connect to ..
Login failed for user 'aliadmin'. (Microsoft SQL Server , Error : 18456 , State 1)

Pictures of this error :

Cannot connect to ..
Login failed for user 'aliadmin'. (Microsoft SQL Server , Error : 18456 , State 1)

Additional Information ...

Please help me ... !

3
  • Did you set any rights to your created login?
    – Nicolas R
    Dec 31, 2015 at 8:45
  • And is your server configured to use both Windows and SQL Server authentication? Check this SO question: stackoverflow.com/questions/1719399/…
    – Nicolas R
    Dec 31, 2015 at 8:46
  • The login is only the first step - you've defined a name that can log in to this SQL Server instance. Now you need to create one or several users in the database this login should be allowed to use
    – marc_s
    Dec 31, 2015 at 10:17

1 Answer 1

2

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, what is the differences between sql server authentication and windows authentication..?

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
1
  • @ALiGAZi, I thinks will be nice if you upvote the answer ;)
    – HEDMON
    Apr 29, 2016 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.