Login failed for user Kyle, could not find a login matching the name

kyle shanks 20 Reputation points
2024-01-29T19:33:42.0333333+00:00

Hai all, can someone help me out Login failed for user Kyle, could not find a login matching the name , how to fix this I can’t login.

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. Azar 26,350 Reputation points MVP
    2024-01-29T19:42:13.4633333+00:00

    Hey kyle shanks This is common and lemme give you a few trouble shoots. Verify if the user exists in your SQL Server database. Sometimes, typos can cause rhis. make sure thee user is mapped to a valid login. Run this query to check

    SELECT * FROM sys.sql_logins WHERE name = 'your_user';
    

    SQL Server logins are case-sensitive. recheck the typos and spellings If all else fails, try restarting your SQL Server.

    If this helps kindly accept the aswer.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Oury Ba-MSFT 20,526 Reputation points Microsoft Employee
    2024-01-29T21:14:21.2733333+00:00

    @kyle shanks Thank you for reaching out. In addition to Azar provided answer which seems to be correct to me. Verify that the SQL Server login exists and that you've spelled it properly. If the login doesn't exist, create it. If it's present but misspelled, correct that in the application connection string. The SQL Server Errorlog will have one of the following messages:

    • Login failed for user 'username'. Reason: Could not find a login matching the name provided.
    • Login failed for user 'Domain\username'. Reason: Could not find a login matching the name provided.This can be a common issue if you deploy an application that uses a DEV or QA server into production and you fail to update the connection string. To resolve this issue, validate that you are connecting to the appropriate server. If not, correct the connection string. If it is, grant the login access to your SQL Server. Or if it's a Windows login grant access directly or add it to a local or domain group that is allowed to connect to the database server. For more information, see Create a Login. https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-18456-database-engine-error?view=sql-server-ver16 Regards, Oury

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.