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.
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';