skip to Main Content

As the title states, I am unable to log in to the default admin user in Magento 2.4 after installation using composer.
I have tried changing the password through PHPMyAdmin using the following command:

UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxYourNewPassword', 256), ':xxxxxxx:1') WHERE username = 'admin';

as well as the following command:

UPDATE admin_user SET password=CONCAT(MD5('qXpassword'), ':qX') WHERE username='admin';

I have also tried creating a new admin user through this command line:

php bin/magento admin:user:create --admin-user='new-admin' --admin-password='!admin123!' --admin-email='[email protected]' --admin-firstname='Jon' --admin-lastname='Doe'

But I get the following error message nonetheless:

The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.

I also tried to "unlock" the users using:

php bin/magento admin:user:unlock adminuser

Which printed

The user account "admin1" has been unlocked

But had no notable effect otherwise.

I have also tried clearing my browser cache and multiple browsers.
Vivalid Chrome Edge Firefox

Any help is appreciated. Many thanks in advance.
Have a great day

2

Answers


  1. Reset credentials using following command

    php bin/magento admin:user:create --admin-user admin --admin-password nimda1997
    

    username:admin

    password:nimda1997

    Login or Signup to reply.
  2. The reason may be that the password strength is not meeting the security requirements

    By default, in Magento 2, the password that meets security requirements must consist of:

    Uppercase letters

    Lowercase letters

    Numeric

    Special characters

    Minimum of 8 characters

    Run the following command in the MySQL to update password to a complex password.

    UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxYourNewPassword', 256), ':xxxxxxx:1') WHERE username = 'admin';
    

    The xxxxxxx character sequence is a cryptographic salt, it is saved in appetcenv.php file

    Note:

    1. Use a complex password instead of YourNewPassword.
    2. Replace admin with your username.
    3. This solutions works if you are not able to login after upgrading to Magento 2.4.x from a lower version.

    Then after try to login again, it will work.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search