Share via

Login failed for user 'MyUser'. (Microsoft SQL Server, Error: 18456)

vmhatup 0 Reputation points
2026-04-07T15:55:50.7433333+00:00

I haven't changed anything in Azure in over a year. All of a sudden, I can't access my sql server databases. From SSMS 2022 I get error "Login failed for user 'myUser'. (Microsoft SQL Server, Error: 18456)"

From the Azure portal login, I get "The username or password is incorrect. Check your credentials and try again."

I can't access the support tickets or an Azure customer rep.

What can I do?

Azure SQL Database
0 comments No comments

3 answers

Sort by: Most helpful
  1. vmhatup 0 Reputation points
    2026-04-07T16:19:41.61+00:00

    I cannot connect at all.

    I have not changed anything in the past year for any of this to happen.

    How can I open a support ticket?

    0 comments No comments

  2. vmhatup 0 Reputation points
    2026-04-07T16:18:20.74+00:00

    I cannot connect at all.

    I have not changed anything in the past year for any of this to happen.

    How can I open a support ticket?

    0 comments No comments

  3. Q&A Assist
    2026-04-07T15:56:04.1366667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Error 18456 with the Azure portal showing “The username or password is incorrect” indicates an authentication failure for the login being used.

    Take these steps, in order:

    1. Verify username and password
      • Confirm that the exact login name and password being used in SSMS match what is used in the Azure portal connection dialogs.
      • If the password might have changed or been forgotten, have the server administrator reset it.
    2. Check if the SQL login is disabled or missing
      • A service administrator with working access to the server must connect (for example, using another admin login) and run in the master database:
             SELECT name, is_disabled FROM sys.sql_logins;
        
      • If the login MyUser appears with is_disabled = 1, enable it:
             ALTER LOGIN MyUser ENABLE;
        
      • If the login does not exist, recreate it with a new password:
             CREATE LOGIN MyUser
             WITH PASSWORD = 'Strong_New_Password_Here';
             GO
        
    3. Map the login to a database user and grant permissions
      • In SSMS Object Explorer, under Databases, select the target database.
      • Create a user mapped to the login and grant a role, for example:
             USE <YourDatabase>;
             GO
             CREATE USER [MyUser]
             FOR LOGIN [MyUser]
             WITH DEFAULT_SCHEMA = [dbo];
             GO
             
             EXEC sp_addrolemember N'db_owner', N'MyUser';
             GO
        
      • Adjust the role to something more restrictive than db_owner if appropriate.
    4. If the login still fails with 18456
      • Check the SQL error log for the 18456 entry and note the state code. The state maps to a specific cause (for example, invalid user ID, wrong password, login disabled, no database, etc.). Use the state description to correct the underlying issue (for example, fix the password for state 8, create the login for state 2/5, enable the login for state 7, fix database access for states 38/46).

    If no administrator account can connect at all, a subscription or server-level admin with portal access must regain access (for example, by resetting the server admin password in the Azure portal) and then perform the steps above.


    References:

    0 comments No comments

Your answer

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