🔥 Just Launched! Werra Premium Template for HyväSee it in Action

How to Reset Magento 2 Admin Password

By Sanjay JethvaUpdated on May 22, 2025 3 min read

If you are a Magento 2 store admin, you know the importance of strong passwords! It helps prevent unauthorized access to the admin panel.

Security experts recommend using strong unique passwords, however, it is the least followed recommendation because unless you know the trick, it is impossible to remember it.

That does not mean you make the unauthorized access easier in Magento 2 admin panel. Go on with a strong and unique password. In case you forget it, I have your back 😃

You can follow any of the below methods to reset Magento 2 admin password when you forget it!

Methods to Reset Magento 2 Admin Password:

Method 1. Reset the Magento 2 admin password via the command line

Run the below command:

php bin/magento admin:user:create --admin-user=admin --admin-password=admin123

Enter email,  first name, and last name

Method to Reset the Magento 2 admin password via the command line

The above command is for creating a new user but you can also use it to reset the admin password in Magento 2 if the user is already available.

Method 2. Reset Magento 2 admin password via Email

  1. Change Magento 2 admin password using the default recovery system.
  2. Go to “Admin Panel”
  3. Click “Forgot Password”
  4. Enter the Email address and click the “Retrieve password” button.
  5. Easily set new password with the reset password link received in the Email.This method is useful when you have forgotten the password and want to reset it.

Method 3. Reset Magento 2 admin password from Account Settings:

  1. Login to admin panel
  2. Go to Account Settings as shown in the figure.
  3. Enter the new password
  4. Enter it again to confirm the change in password.
  5. Enter your old password to confirm your identity.
  6. Save Accounts.This method is useful when you remember the old password and simply want to reset it.
1_reset admin password from Account settings

method is useful when you remember the old password and simply want to reset it.

Method 4. Reset Magento 2 admin password via phpMyAdmin

  1. Go to phpMyAdmin
  2. Go to the Database section and search for the admin_user table
  3. Run the below query as shown in the figure:
UPDATE admin_user SET password = SHA2('NewPassword', 256) WHERE username='admin';
SQL Query - PhpMyAdmin password reset method - Meetanshi_1

That was all about changing the Magento 2 admin password.

Thank you.

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.