How to reset your magento admin password

How to reset your magento admin password

You can reset your Magento administrative password directly through the database related to your website application. You can access the database through cPanel -> phpMyAdmin tool.

Once you have opened the phpMyAdmin tool choose the corresponding database* from the dropdown menu on the left side. After that click on the SQL tab in order to be able to execute the following MySQL query. Note that the query will differ depending on the Magento version you have:

For Magento 1.9 and older

UPDATE admin_user SET password = CONCAT(MD5(‘xxNewPassword’),:xx’) WHERE username =ADMIN’;

Where NewPassword is your new magento admin password. And Admin is your username. Replace these to whatever values you want.

For Magento 2:

UPDATE admin_user SET password = CONCAT(SHA2(‘xxNewPassword’, 256),:xx:1′) WHERE username =’ADMIN’;

Where NewPassword is your new magento admin password. And Admin is your username. Replace these to whatever values you want.

 

The x..x character sequence is for cryptographic purposes. It can be anything you want, but make sure you use the same value in both parts of the SQL statement.

 

Execute the query and your new password will be set.

*If you are not sure exactly which database is related to your website you can find its name inside the following file:

~/app/etc/local.xml

You can open the file through cPanel -> File manager and search for the following line:

<dbname><![CDATA[user_magedatabase]]></dbname>

where user_magedatabase is the name of the database.

 

Now lets clear the magento cache

After you run the sql query go to cPanel->File Manager>public_html>var>

And here Rename or delete the Cache folder.

Then go to the admin url and use your new password.

LEAVE A COMMENT