I want to reset one of my customer's password through database. What is the query for this in magento 2.
Try to execute this query in your database :
UPDATE `customer_entity` SET `password_hash` = SHA2('admin123', 256) WHERE `entity_id` = 1;
UPDATE `customer_entity` SET `password_hash` = CONCAT(SHA2('xxxxxxxadmin123', 256), ':xxxxxxx:1') WHERE `entity_id` = 1;
- replace value of password instead of admin123
- replace value of xxxxxxx with crypt key.
You can get crypt key from app/etc/env.php file
<?php return array ( ... 'crypt' => array ( 'key' => 'c51288337454ecab8280de9989b7624d', ), ...
From admin panel,
You can click on "Reset Password" in customer edit form. Mail will be sent on appropriate email ID. Then, you can reset password.
Note : Take backup of your db before execute.