5

How to enable admin account.

I get account disabled.

enter image description here

I tried to :

  1. php bin/magento admin:user:unlock admin (admin - username)

  2. UPDATE `admin_user` SET `password` = MD5('mypassword') WHERE `username` = 'admin';

  3. Cleared cache and ran setup upgrade.

But still, I'm unable to log in.

1

3 Answers 3

10

Run below query to direct database.

Example is for reset password for admin user.

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

NewPassword : Replace it with your password.

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

5
  • cool..thanks worked... but why dint php bin/magento admin:user:unlock admin dint work?
    – Sushivam
    Oct 19, 2016 at 11:27
  • My solution is for if you want reset admin password from directly from database. Oct 19, 2016 at 11:30
  • what about this? UPDATE admin_user SET password = MD5('mypassword') WHERE username = 'admin';
    – Sushivam
    Oct 19, 2016 at 11:33
  • 1
    It will work for magento 1.x. Oct 19, 2016 at 11:34
  • it is useful when you do not know why does admin:user:unlock not unlock the account Aug 24, 2017 at 13:52
10

Run below command to root directory using SSH.

php bin/magento admin:user:unlock ADMINUSERNAME

command will unloack user and after you can login with your existing username and password.

0

If the admin account is inactive, you can't unlock it from the CLI. You have to have access to the database and check is_active field from the admin_user table.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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