In this blog, I will show you how to reset the admin password for Magento 1 and Magento 2.
There are 2 ways to reset the admin password in Magento
- Reset Magento admin password via Email
- Reset Magento admin password via phpmyadmin (if an email is not working correctly on your website, use this option)
Reset Admin Password Via Email:
The easiest way to reset the admin password in Magento is to request a new one through email. This is the Magento default password recovery feature.
To do this, follow the steps below,
- On your web browser, go to Magento admin panel.
- Click on the Forgot your password? link.
- In the Email Address text box, type the email address which associated with the admin account.
- Click Retrieve Password button. Magento sends a message to the given email address.
- Open your email box, click the reset password link and set your new password. (Note: The link is valid for 24 hours)
Reference image for Magento 2
Reference image for Magento 1.9 and older versions
Reset Admin Password Via phpMyAdmin:
If an email is not working properly on your website, you can use phpmyadmin to reset the admin password manually on the database.
Here is the SQL query to reset the admin password in Magento 2.0 and above,
UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxYourNewPassword', 256), ':xxxxxxx:1') WHERE username = 'admin';
In the above query, xxxxxxx character sequence is a cryptographic salt, it is saved in app\etc\env.php file.
Magento 1.9 and older versions:
Here is the SQL query to reset the admin password in Magento 1.9 and the below version,
UPDATE admin_user SET password = MD5('YourNewPassword') WHERE username = 'admin';
Hope this helps.