Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save phaelfp/b5e0f0ac81049899b514de02fcfab091 to your computer and use it in GitHub Desktop.
Save phaelfp/b5e0f0ac81049899b514de02fcfab091 to your computer and use it in GitHub Desktop.
Magento 1
SET @passwd='newpassord', @salt='5k';
For admin
update admin_user SET password = CONCAT(MD5(CONCAT(@salt , @passwd)), CONCAT(":", @salt )) where email = '[email protected]';
For customer
update customer_entity_varchar set value = CONCAT(MD5(CONCAT(@salt , @passwd)), CONCAT(":", @salt ))
where entity_id IN (select entity_id from customer_entity where email = '[email protected]')
and attribute_id in ( select attribute_id from eav_attribute where entity_type_id = 1 and attribute_code = 'password_code' )
and entity_type_id = 1;
Magento 2
SET @passwd='newpassord', @salt=MD5(RAND());
For admin
update admin_user SET password = CONCAT(SHA2(CONCAT(@salt, @passwd), 256), ':', @salt, ':1') where email = '[email protected]';
For customer
update customer_entity SET password_hash = CONCAT(SHA2(CONCAT(@salt, @passwd), 256), ':', @salt, ':1') where email = '[email protected]';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment