Magento 2 Reset Customer Password in Database

You might come up with situation like you need to reset customer password for some reason. But there is no out of the box way to do that if you don’t own the email address for that account. You can do it directly in the database in such situation.

In order to do that, you should have access to the database query editor in some way. May be via phpMyAdmin, Mysql Client, directly through command line (SSH). Simply you can do that by executing the bellow command.

UPDATE `customer_entity`SET `password_hash` = CONCAT(SHA2('xxxxxxxxYOURPASSWORD', 256), ':xxxxxxxx:1')WHERE `entity_id` = 1;

Make sure to replace YOURPASSWORD with the new password (keep xxxxxx) and entity_id with the customer id.

That’s it!

Leave a Reply

Your email address will not be published. Required fields are marked *