Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  CMS FAQ  >  How to reset the password for Magento admin panel?
Top Scroll

How to reset the password for Magento admin panel?

 4 min

Generally, when you forget your password, using the Magento password recovery feature will help reset the password by e-mail. But, if this option isn’t available (for example, if e-mail on your site is not working properly), you can use phpMyAdmin for resetting the password manually in the database.

METHOD #1: E-MAIL

You can reset the Magento administrator password quickly and easily by requesting a new one via e-mail. For this, follow the below steps:
1. Browse for the Magento login page.
2. Click on forgot your password link.
3. You will be asked to enter the Email Address associate with the account. Type the e-mail address.
4. Click on Retrieve Password. A message will be sent by Magento to the e-mail address you have inserted in the previous step.
5. Click on the link to reset the administrator password sent in the email.

METHOD #2: PHPMYADMIN

It is also possible to modify the Magento administrator password directly in the database with phpMyAdmin. For this, below is the procedure as per your Magento version.

Magento 2

In Magento 2 database, you can follow the below steps to reset the administrator password directly:
1. Log in to cPanel.
2. In the cPanel home screen, go to the Databases section and click on phpMyAdmin.
3. Click the Magento database in the left-hand pane of phpMyAdmin. A list of tables in the database will get displayed.

Note: The Magento database is typically the username_mageXXX, where username means your cPanel username and XXX means a three-digit number.

4. Click SQL on the top menu bar.
5. A SQL query text box will appear where you will need to copy and paste the below statement. Replace NewPassword with the new password and replace both occurrences of xxxxxxxx with sequence of any random character:

UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxxNewPassword', 256), ':xxxxxxxx:1') WHERE username = 'admin';

Note:

  • When you use this command, it is assumed that that you want to change the password for the admin user account. If you want to change the password for another account, you just need to change the username field to the correct value.
  • The xxxxxxxx character sequence is similar to cryptography. You can insert anything you want (the length doesn’t matter), but ensure you use the similar value in both parts of the SQL statement.
  • If table prefixes are used by your Magento installation, ensure that you are adding it to the table name. For example, if your Magento uses prefix mg_, you will need to type the following command:
    UPDATE mg_admin_user SET password = CONCAT(SHA2('xxxxxxxxNewPassword', 256), ':xxxxxxxx:1') WHERE username = 'admin';

6. Click on Go. With this the phpMyAdmin will update the database, and you can log in to Magento as the administrator with the new password.

Magento 1.9 and older versions

In order to reset the administrator password directly in Magento 1.9 and older versions, you will need to follow the below steps:
1. Log in to cPanel
2. Click on phpMyAdmin in the Databases section of the cPanel home screen.
3. In phpMyAdmin, click the Magento database in the left-hand pane. You will get a list of tables in the database.

Note: Here, the Magento database is username_mageXXX, where username indicates your cPanel username, and XXX indicates a three-digit number.

4. Click on SQL on the top menu bar.
5. In the SQL query text box, copy and paste the below statement. Replace NewPassword with your new password and replace both occurrences of xx with sequence of any random two-characters.

UPDATE admin_user SET password = CONCAT(MD5('xxNewPassword'), ':xx') WHERE username = 'admin';

Note:

  • This command usage indicates that you want to change the password for the admin user account. For changing the password for another account, insert the correct value in the username field.
  • The xx two-character sequence is similar to cryptography. You can insert anything you want to but ensure that same value is used in both parts of the SQL statement.
  • In case, your Magento installation uses table prefixes, ensure that you add it into the table name. For example, if your Magento table prefix is mg_, you will type the below command:
    UPDATE mg_admin_user SET password = CONCAT(MD5('xxNewPassword'), ':xx') WHERE username = 'admin';

6. Click on Go. With this, the phpMyAdmin will update the database, and you can log in to Magento as the administrator with the new password.

So, this is the way you can reset the password for Magento admin panel.

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.