Magento 2 — Update Customer/Admin Password via Query

Update password can be done via mysql query, simply just execute this query to update customer’s password :

UPDATE customer_entity SET password_hash = CONCAT(SHA2('xxxxxxxTypeYourPasswordHere', 256), ':xxxxxxx:1') WHERE email = 'johndoe@example.com';

And this query for admin :

UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxTypeYourPasswordHere', 256), ':xxxxxxx:1') WHERE email = 'johndoe@example.com';

Notes :

  • Change TypeYourPasswordHere by new password without removing xxxxxxx
  • Change johndoe@example.com by email of customer/admin.

I wrote these tutorials for myself in future when I forget for the next steps.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store