Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 283
Ropstah Avatar asked Aug 19 '11 09:08

Ropstah


People also ask

Could not find a login matching the name provided in SQL Server?

The error message is telling you exactly what's wrong. You are trying to connect to a SQL Server instance, but the account you are trying to use is not defined as a login for that instance.

How do you find who created Logins on SQL Server?

Answer: In SQL Server, there is a catalog view (ie: system view) called sys. sql_logins. You can run a query against this system view that returns all of the Logins that have been created in SQL Server as well as information about these Logins.

How do I find my SQL Server login credentials?

Step 1 − After connecting to SQL Server Instance, expand logins folder as shown in the following snapshot. Step 2 − Right-click on Logins, then click Newlogin and the following screen will open. Step 3 − Fill the Login name, Password and Confirm password columns as shown in the above screen and then click OK.

Where are Logins stored in SQL Server?

In order to connect to SQL Server using SQL authentication, a person needs to provide a login and password when they connect. The password for a SQL Authenticated login is stored in the master database.


1 Answers

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.

like image 169
Upendra Chaudhari Avatar answered Oct 13 '22 05:10

Upendra Chaudhari