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
Reset credentials using following command
username:admin
password:nimda1997
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.
The xxxxxxx character sequence is a cryptographic salt, it is saved in appetcenv.php file
Note:
Then after try to login again, it will work.