Magento 2 — Update Customer/Admin Password via Query

Fiko Borizqy
1 min readMar 24, 2020

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.

--

--

Fiko Borizqy

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