How To Reset Admin Password in Magento

How To Reset Admin Password in Magento

January 20, 2017 As an ecommerce website developer or magento website developer, sometime we  get the a situation when we forget the magento website admin access detail. To reset the password of any magento website is very simple. We just need to run a sql query. First you need to verify the database name. You can find out the database access detail from below file: Magento Installation Directory/app/etc/local.xml Open the file in any editor and you will get the following code
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[user_name]]></username>
<password><![CDATA[password]]></password>
<dbname><![CDATA[database_name]]></dbname>
Now you can access the database through phpmyadmin. Once you select the database, you just need to open sql tab and run the query: phpmyadmin sql tab

For Magento 1.9 and older

UPDATE admin_user SET password = CONCAT(MD5('mypassword'), ':xx') WHERE username = 'ADMINUSERNAME';

For Magento 2:

UPDATE admin_user SET password = CONCAT(SHA2('mypassword', 256), ':xxxxxxxx:1') WHERE username = 'ADMINUSERNAME';
*Note: You need to replace following: mypassword = with your password ADMINUSERNAME : your admin user name xx or xxxxxxxx : any random string with same length. Once you will finish above execution, you will be able to login magento admin with new password. Thanks

Related Posts

from my blog


Hire Full Stack Developer: Unlocking the Power of Versatility

April 5, 2024

Why hire full-stack programmers? What exactly is Full Stack Development? Developers who are full stacks can manage all aspects of software development including managing databases, designing user interfaces or configuring...

Why Should Your Hire Freelance Web Developer: The Top Benefits

May 17, 2022

When developing a website or an app, there are two major ways to do it - outsource the job to a web development company or hire a freelancer to get...

7 Reasons Why You Should Hire A Freelancer Developer Over A Development Team

May 13, 2022

Are you confused between hiring a freelance web developer vs a development team? Then we suggest getting a freelancer over a team! Why? Because they are much better workers than...