If you want to log in to the Magento backend, "Username" and "Password" are required fields. If you forget one of them, it will be a hassle. Therefore, resetting the administrator password is very important for every website. With Magento 2, you can click the "Forgot Password" link, and then you can immediately send a temporary password to the email address associated with the account. If the administrator account is locked, this tutorial will help you. Let us follow the steps below to reset your admin password in Magento 2.
Simple Application Server
USD1.00 New User Coupon
* Only 3,000 coupons available.
* Each new user can only get one coupon(except users from distributors).
* The coupon is valid for 30 days from the date of receipt.
Reset Magento 2 administrator password
There are 3 ways to reset the administrator password in Magento2:
Solution 1: Reset Magento 2 administrator password in phpmyadmin
Solution 2: Reset your Magento 2 password from the management console
Solution 3: Reset Magento 2 administrator password via command line
Solution 4: Reset Magento 1 administrator password via email
Solution 1: Reset Magento 2 administrator password in phpmyadmin
Go to phpmyadmin and copy the following sql query:
UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxYourNewPassword', 256),':xxxxxxx:1') WHERE username ='admin'; The password of the xxxxxxx character sequence, which is saved in the app\etc\env.php file
<?php
return array (
...
'crypt' =>
array (
'key' => '525701df74e6cba74d5e9a1bb3d935ad', //cryptographic salt
),
...
Solution 2: Reset your Magento 2 password from the management console
If you forget your password, please click the hte Forgot Your Password? link.
How to reset admin password Magento 2 forgot password
- Enter the email address associated with the administrator account.
- Click Retrieve Password. If there is an account associated with that email address, an email will be sent to reset your password. To prevent emails from being sent to the spam box, please enable SMTP
Solution 3: Reset Magento 2 administrator password via command line (CLI)
We type in the Magento 2 root folder:
php bin/magento -h
It displays the administrator command line:
...
admin
admin:user:create Creates an administrator
admin:user:unlock Unlock Admin Account
...
Magento 2 does not support resetting the password via the command line. However, we can create a new admin account and then use the new account to reset the old account.
bin/magento admin:user:create
Solution 4: Reset Magento 1 administrator password via email
Go to Magento admin panel, the default is your-domain.com/admin
Click Forgot your password
Enter the email address associated with the administrator account in the Email Address input box
Click Retrieve Password to reset the password.
Open your email box and check the reset password link. The link is valid for 24 hours. To prevent emails from being sent to the spam box, enable SMTP.