How to reset lost admin password in Magento 2?

I tried to reset the admin password via Phpmyadmin in admin_user table but this doesn't seems to work. Also on chrome I am getting "This webpage has a redirect loop" error when loading admin page.

Solutions

Run below query to direct database.

An example is for reset password for admin user.

UPDATE admin_user SET `password` = SHA2('NewPassword', 256) WHERE `username`='admin';

NewPassword: Replace it with your password.

I hope it will work for you. Let me know if you any difficulty.

You can use Magento CLI to create new admin user with the following command, then you can go and change password of your original user.

Execute this from the root of your magento installation:

php bin/magento admin:user:create --admin-user="admin" --admin-password="123123q" --admin-email="[email protected]" --admin-firstname="Admin" --admin-lastname="Admin"

Run the following SQL queries to reset the admin password:

SET @salt = MD5(UNIX_TIMESTAMP());
UPDATE admin_user SET password = CONCAT(SHA2(CONCAT(@salt, 'MyNewPassword'), 256), ':', @salt, ':1') WHERE username = 'admin';

Similar questions

Password reset updated but still able to login with old password in magento2
I have reset my password. It shows as Password updated. But still i can able to login with old password. Newly updated password is not working. My magento version is 2.2.6. Note: I am using Store session In DB instead of files. Can anyone look into this issue please.
I can't log into my local copy of Magento -- how to use lost password with local copy of software?
I have a local install of Magento on my Mac using MAMP. I need to retrieve my password, but the lost password is obviously not working out of the box. Is there a way with MAMP to use the lost password feature (e.g. by activating a mail sever)?
Magento 2 devbox reset scipt command not found m2devbox-reset.[bat|sh]
I am trying to reset Magento devbox after restarting my mac and i keep getting the following error when running the command in the root folder. user-iMac:build-7204cee62e1e6ccb35bbdfc977c5e522 user$ m2devbox-reset.[bat|sh] -bash: m2devbox-reset.[bat: command not found -bash: sh]: command not found
Magento admin password reset using md5, why?
I was surprised that we can access to admin backend resetting admin user password with md5. This is some kind of Magento feature or vulnerability? Why password is not depend on encryption key in local.xml?
magento admin :reset password email via php code
I earlier posted question to get customer rest password via code and below code works fine: But what if want to reset password of one of admins , how can I use above code to work ?
Theme does not apply to Reset Password page at Admin: Magento 1.9.3.6
I applied new theme to Magento Admin. All the pages and new modules have this new theme / css. But the Reset Password page does not has this new theme / css. Can anybody help me why theme does not apply to Reset Password page? Thanks in advance

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.