In case you have forgot your Magento admin password and need to reset it then you can use the forgot password link provided in the login screen or you can directly reset it in the database.
On the “Forgot your password” screen enter admin user email address and click “Retrieve Password” button, an email will be sent with link to reset your password.
Lets now see how to reset the admin password in database using MySql Command-Line Tool.
Before proceeding think of:
- New Password
- Salt (A two letter word)
Magento uses md5 encryption to encrypt the passwords.
Suppose you want your new password to be “[email protected]” and you select the salt as “xp”.
Login to your Magento MySql database and run the following queries:
SELECT * FROM admin_user;
Locate the username from the resultset for which you want reset the password.
Assuming that your username is ‘admin’, run the following query to reset the password.
UPDATE admin_user SET password=CONCAT(MD5('[email protected]'), ':xp') WHERE username='admin';
In case you are more comfortable using phpMyAdmin then you can proceed as follows:
Step 1. Open the `admin_user` table
Step 2. Locate the row for the user whose password you want to change and click on the “Edit” link. Now select the MD5 function to be applied to the password field, paste salt+password (in our case its “[email protected]”) as the password field value and click the “Go” button to save the row.
Step 3. After saving click the “Edit” link again to edit the row once again. You have the password hash in the password field value and now you need to add the salt value to it. So, append “:”+salt to the password field value (:xp in our case) and click the “Go” button to save the row.
Now you can login with the new password “[email protected]”.