If you forget your Magento administrator password and cannot log in, you can reset it either through the email recovery feature or by manually updating the database. On ruachost.com, both Magento 2 and Magento 1.9 (and older) support these methods.
Method 1: Reset via Email (Recommended)
-
Go to your Magento Admin Login Page.
-
Click Forgot your password?.
-
Enter the email address associated with your admin account.
-
Click Retrieve Password.
-
Magento will send a reset link to your email.
-
Click the link and set a new password.
✅ This is the quickest and safest method if email is working correctly.
Method 2: Reset via Database (phpMyAdmin)
If email recovery is unavailable (e.g., email not configured properly), you can reset the password directly in the database.
Magento 2
-
Log in to cPanel or your Client Area.
-
Open phpMyAdmin.
-
Select your Magento database (usually named
username_mageXXX). -
Click the SQL tab.
-
Run the following query (replace
NewPasswordwith your new password andxxxxxxxxwith a random salt string):UPDATE admin_user SET `password` = CONCAT(SHA2('xxxxxxxxNewPassword', 256), ':xxxxxxxx:1') WHERE `username` = 'admin'; -
Click Go.
-
Log in to Magento with your new password.
Magento 1.9 and Older
-
Log in to cPanel or your Client Area.
-
Open phpMyAdmin.
-
Select your Magento database.
-
Click the SQL tab.
-
Run the following query (replace
NewPasswordwith your new password andxxwith a random two‑character salt):UPDATE admin_user SET `password` = CONCAT(MD5('xxNewPassword'), ':xx') WHERE `username` = 'admin'; -
Click Go.
-
Log in to Magento with your new password.
Important Notes
-
Always back up your database before running SQL queries.
-
Replace
adminin the query if your administrator username is different. -
Use a strong password (mix of uppercase, lowercase, numbers, and symbols).
-
If your Magento installation uses table prefixes, add them to the table name (e.g.,
mg_admin_user).