Once you have forgotten your Magento administrator password and would like to recover and change your password, you may do this easily via your database manager like PHPMyadmin.
Change password by running SQL Query
- Go to to your phpMyAdmin. browse to your database
- Select the SQL tab
- Then, in the run SQL text field, enter the SQL command line below, then hit Go (to execute changing the new password in MD5 format of user admin)
Change password by manually changing values in the phpMyAdmin table and record fields
Alternately, the same thing is effected when:
- In your PHPMyAdmin, navigate to your database, then go to admin_user table
- Click on admin_user to edit or browse, then edit the admin user
- Under password, select MD5 from the Function list, then delete existing encrypted value, then your new preferred and secured password
- Scroll down, click Go to Save. Go back to your login page, refresh, then retry logging in which should now work.
Magento login still not working despite resetting admin password?
If you notice, the login does not seem to work, after clicking login, nothing seems to happen (action seems to go back to the same login page without any errors), perhaps you are working on a non-live domain or production site that is NOT mapped to an actual domain. In short, perhaps you are working on a Magento site on any of the following state:
- localhost or 127.0.0.1 (using e.g. WampServer, XAMPP, etc)
- live server but using IP addresses, and similar
- or other non-domain configured setup
Only real domains store cookies, therefore, you need to comment out (inserting double slashes at beginning of line code) some cookie variables in ../app/code/core/Mage/Core/Model/Session/Abstract/Varien.php, specifically the following lines:
- domain
- secure
- httponly
$cookieParams = array(
‘lifetime’ => $cookie->getLifetime(),
‘path’ => $cookie->getPath() //,
// ‘domain’ => $cookie->getConfigDomain(),
// ‘secure’ => $cookie->isSecure(),
// ‘httponly’ => $cookie->getHttponly()
);
Go back to your login page, refresh, then retry logging in which should now work.