How to Reset Customer Password From Database in Magento 2
We have a love-hate relationship with passwords, isn’t it?
We like the idea of securing our data or account with passwords but hate to remember them.
Magento 2 store customers feel the same!
A very common feature used by major sites is to reset the password when a user forgets it. Doing so is a win-win situation as the user can continue using your service and you do not lose a potential customer. The cherry on top, you get the medal of good user experience!
Hurray!
So, when you are on the other side of the stage, how do you manage to change the customers’ passwords when they forget them?
Here’s the solution to reset customer password from database in Magento 2. Bookmark this post as it is going to be handy the next time your store customer comes to you requesting for password change.
Method to reset customer password from database in Magento 2:
1 2 3 |
UPDATE `customer_entity` SET `password_hash` = CONCAT(SHA2('xxxxxxxxENTERCUSTOMERPASSWORD', 256), ':xxxxxxxx:1') WHERE `entity_id` = 1; |
Simple, isn’t it? Also you can let login your customers programmatically in the Magento 2 store without password, you can make it possible by making them login only with Email ID.
Any doubts? Mention them in the Comments section below and I’ll help you out.
Feel free to share the solution with fellow developers via social media.
Thanks.
Related Articles:
- How to Configure Password Options in Magento 2
- How to Reset Magento 2 Admin Password
- How To Display Error, Success, & Warning Message In Magento 2
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
Reindexing Programmatically In Magento 2 Simplified
How to Implement No Contact Delivery for Magento 2 Stores to Avoid COVID-19 Spread
Next