Magento Reset Admin Password

In this blog, we will see how you can reset magento admin password in case you have lost it and cannot recover it using Forgot Password option.

We will assume that you have server access to magento i.e database or ftp access.

Using Database

Changing magento password using database is very easy. Open your database in phpmyadmin, and open the “admin_user” table. There you will see a row, with your admin username. Before, resetting the password you need to decide on two things,

  • New Password
  • Salt (any 2 letter word)

In my case i will take my new password to be “yourpassword” and salt to be “XY”. Next go to any md5 generator site and generate md5 of string “XYyourpassword”. The md5 in my case being “e21ffc5b40e40077ba94c5ee63733655”. Now, edit the table row, in admin_user table, for whom you want to change the password. In the password column, put in the md5:salt i.e in my case “e21ffc5b40e40077ba94c5ee63733655:XY” and then save the changes. Now you should be able to login with your new password through admin.

Only FTP Access

To login into magento admin, using only ftp access is a little tricky. Through FTP open the class Mage_Admin_Model_User located at app\code\core\Mage\Admin\Model\User.php
Next find the authenticate() function around line no: 225. Inside the authenticate function, this code is written


You need to add the line return true; after this i.e

return true;

And that’s it, now you login in admin using any password. Since, we have skipped the code for password checking, login using any password and then change the password in admin from System -> Permission -> Users.