How to make SQL Server find a login matching the name provided?

Ropstah picture Ropstah · Aug 19, 2011 · Viewed 78.6k times · Source

I have just restored a database backup to my local SQL Server express instance.

  1. In management studio under the server instance node I went to: Security -> Logins -> New login...
  2. Then I filled in a login name, password and chose SQL Server authentication. And at the bottom I selected the newly restored database to be the Default database.
  3. At the User Mapping 'tab' at the left, I mapped the user to the newly restored database and gave it "db_owner" role.

When I try to login the following error is given in the log:

Login failed for user 'username'. Reason: Could not find a login matching the name provided. [CLIENT: ]

How can I make SQL Server find the login matching the name I provided?

Other info:

  • Named pipes are enabled
  • TCP/IP is enabled
  • Remote connections are allowed

Answer

Upendra Chaudhari picture Upendra Chaudhari · Aug 19, 2011

Please make sure you have selected "SQL Server Authentication" mode for user you created from Server > Security > Logins option.

Another possibility, is that you created the SQL Server login using Management Studio, and the option requiring the user to change the password on first login was checked. If you didn't immediately login with Management Studio, and change the password, then the attempt to login from the other machine is not able to pop up a dialog box to change the password and so it fails.

try it by removing user and create again.