سؤال

If I have access to my database, can I manually override a customer password? This is my local development environment.

I have little knowledge of password encryption but I would like to be able to log out on a previously setup customer account and my forgot password link is not working.

As far as I can see this is stored in the customer_entity_varchar table.

هل كانت مفيدة؟

المحلول

Try this:

Replace testtest with your new password and $customer_entity_id with the customers entity_id in the customer_entity table.

update customer_entity_varchar set value = md5('testtest') where entity_id=$customer_entity_id and attribute_id in (select attribute_id from eav_attribute where attribute_code = 'password_hash' and entity_type_id = 1);

نصائح أخرى

If you have the access to database through phpmyadmin the follow this steps. customer_entity is the responsible table for this.

  1. select the customer and click on edit.
  2. Check for the password_hash column name.
  3. Remove the total value which is already existing in text field next to it.
  4. Now enter your new password(normal letters/special symbols/numerics)
  5. Now before that there is a drop down. select MD5 from here.
  6. Now click on GO button.

That's it. Your password has been modified.

NOTE: In magento2 the table is customer_entity, but I dont remember what it is for Magento1. But the process is same for both.

Here is snippet if you have the customers e-mail address, just replace $EMAIL below with customers e-mail address and $PASSWORD with plain-text password.

UPDATE `customer_entity_varchar` 
    SET `value` = MD5("$PASSWORD") 
    WHERE `entity_id` IN (SELECT `entity_id` FROM `customer_entity` WHERE `email` = "$EMAIL") 
    AND `attribute_id` IN (SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` = "password_hash" AND `entity_type_id` = 1) 
    LIMIT 1;
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top