Skip to content

Instantly share code, notes, and snippets.

@lnoering
Last active October 20, 2020 13:36
Show Gist options
  • Save lnoering/0c666773c20377313c4753776ce06b3e to your computer and use it in GitHub Desktop.
Save lnoering/0c666773c20377313c4753776ce06b3e to your computer and use it in GitHub Desktop.
[M2] - Change Password of Customer in Magento 2.

Change Customer Password by SQL

  • Change values:
    • DATABASE
    • EMAIL
    • PASSWORD

Code

USE <DATABASE>;

SET @email='<EMAIL>', @passwd='<PASSWORD>', @salt=MD5(RAND());

UPDATE 
	`customer_entity`
SET 
	`password_hash` = CONCAT(SHA2(CONCAT(@salt, @passwd), 256), ':', @salt, ':1')
WHERE 
	email = @email;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment