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.
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:
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.