0

i have tried to reset password from mysql cli. myqueri is for that UPDATE admin_user SET password = CONCAT(SHA2('12345678admin', 256), ':12345678:1') WHERE username = '*****'

  • after update password i am not able to login admin backend in magento2 – Maruti_magento2 Oct 3 '19 at 9:30
  • Please respond to the comments in the right place :)) – MichaelHa Oct 3 '19 at 9:39
1

You can add a new user if you don't remember your password

php bin/magento admin:user:create --admin-user="your_name" --admin-password="your_pass" --admin-email="your_email" --admin-firstname="first_name" --admin-lastname="last_name"

Thanks

| improve this answer | |
0

Magento 2 does not support reset password via command line cli. However, we can create a new admin account by cli, then use the new account to reset the old one. or update by phpmyadmin database direct query:

UPDATE admin_user SET `password` = CONCAT(SHA2('xxxxxxxxNewPassword', 256), ':xxxxxxxx:1') WHERE `username` = 'admin';
| improve this answer | |
0

Step 1: SQL query

NewPassword with the new password, and replace both occurrences of xxxxxxxx with any random character sequence:

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

reference link: https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/magento1/resetting-the-magento-administrator-password

Step 2:

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.

<path_to_magento>/bin/magento admin:user:create --admin-user="admin" --admin-password="123123q" --admin-email="admin@example.com" --admin-firstname="Admin" --admin-lastname="Admin"

reference link: How to reset lost admin password in Magento 2?

Hope this will help you.

| improve this answer | |
0

Magento supports out of the box password change via CLI. You should use the command to create an admin user, but enter details of existing user bin/magento admin:user:create

Then you should enter a new admin password. Pay attention. The email you enter should be the same as in the database, otherwise, you'll catch an exception.

| improve this answer | |
-1

Magento 2 doesn't support this out of the box. You can however download n98-magerun for magento 2.

Once installed, you will have a few new Magento CLI commands. One of these new commands will let you change the password for your admin user.

n98-magerun2.phar admin:user:change-password username password

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.