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.


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.

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

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.

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.