I am running a copy of SQL Server 2008 Standard and trying to setup a new user login for access to a DB through a web app.
- I am using Security -> Logins -> Add login to create the user.
- Login name and password is specified
- Default database has been selected
- I am using a "public" server role
- I am mapping to the DB I require in "User Mapping" and selected it as "db_owner"
...The login/password combination is repeatedly failing on the app, and even when I try to login through SQL Server Management Studio I am receiving:
Login failed for user 'username'. (Microsoft SQL Server, Error: 18456)
What could be the cause of this?
Check if the SQL Server is running SQL Server Authentication. In Microsoft SQL Server Management Studio, right click the database server, choose Properties and see the Server authentication section in the Security page.
This blog post could help finding what is causing the error:
Understanding "login failed" (Error 18456) error messages in SQL Server 2005
Look at the error state:
Thanks alot,
It was only set to windows authentication.
Right click on your instance -> goto Server Properties -> Security -> then Change to SQL Server and Windows Authentication Mode
You might have to restart your intance.
Thanks again, Baskar
Create an additional test login to establish whether the problem is limited to just your original login. If your password uses special characters, type the password into Notepad and check that what you see in Notepad is the expected password. I had a similar issue and it was down to the keyboard being setup for US layout instead of UK. Good luck!
"User" and "login" in SQL Server are two different things.
Try:
Hope that helps ;-)