How to reset admin password in Magento 2

Complicated and varied passwords are one of the best ways to enhance your account security. Especially, if you have an admin account of an ecommerce store. However, such passwords are hard to retain in the memory, you may forget them and lose the ability to manage your Magento 2 store as an admin.

Luckily, there are two different methods to restore your admin password. The first one is quite easy while the second is more complicated (but can help you in the most deadlock situations).

Email Admin Password Recovery in Magento 2

Administrator is just another user with extended privileges. That’s why the admin password in Magento 2 can be recovered with the help of the default recovery system. You need to open the admin panel of your store and click on the «Forgot your password?» link. Then, fill in your email address associated with the admin account and hit the «Retrieve Password» button.

In a moment, you’ll receive receive an email with the link that allows you to reset your current password or set a new one.

Change Admin Password with phpMyAdmin

Alternatively, you can reset the admin password directly in the Magento 2 database using phpMyAdmin.

First, you need to login to cPanel if you have one installed. Then, in the «Databases» section of the cPanel, select the phpMyAdmin link.

Magento 2 password reset

On the next step, you should choose the Magento database from the left phpMyAdmin panel. Generally, the Magento database is called username_mageXXX, where username reflects your cPanel username and XXX is a three digits.

Then, you’ll get to the list of tables. You need to click on the «SQL» option in the top menu bar. Now, you should copy the following line into the SQL query box and replace the NEWPASSWORD with your brand new one:

Magento 2 admin password

UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxxNewPassword', 256), ':xxxxxxxx:1') WHERE username = ‘admin';

Note that each xxxxxxxx sequence should be replaced with any random characters.

Finally, click the «Go» button to accept and apply the changes and update the database.

Using this two solutions you can change your forgotten or lost password for the admin account in Magento 2.



posted on Jan 2, 2018
This is not working


posted on Jan 2, 2018
Check the class

Post select from table admin_user for yuor Iser ID

You should take a look at is_active and lock_expires to find out: is it password or status issue

narendra sharma

posted on Mar 22, 2018
I have simple way to update the admin password from PHPMYADMIN without writing a single line of code, just register as a user from your website frontend. Then goto PhpMyAdmin copy the password of the user you created then goto the admin table and paste the password copied from the user table, That's it now you can login to the Magento Admin using the same password.

Sergey Shishko

posted on Feb 11, 2020
You can try create new admin instead restore old password.
Use CLI command from magento root directory:
php bin/magento admin:user:create

Submit Comment

* Required Fields