Sunday , December 22 2024
Home > Magento Tips & News > Magento 2 Tutorials > Store Settings > How to Reset Admin Password in Magento 2

How to Reset Admin Password in Magento 2

How to reset admin password in Magento 2

Besides the Magento Two Factor Authentication, a strong password is another way to protect your Magento account from malicious 3rd parties. However, because of the varied and complicated character sequence, sometimes you may lose or forget your password. So in this tutorial, I’ll walk you through 4 ways to reset your lost Magento 2 admin passwords. Let’s dive straight into it!

Method 1: Reset Magento Admin Password Using the Default Recovery System

In the login window, click Forgot your password?:

The log in window

Then, enter your email address and captcha:

Enter email address and captcha

After that, click Retrieve Password. You’ll receive a confirmation email like this:

Confirmation email

Click the link to open a new window allowing you to reset your password:

Reset password window

Method 2: Reset Magento Admin Password From the Dashboard

This method is useful when you remember your password and want to replace it with a new one. From the admin dashboard, click the user name, and in the dropdown list, select Account Setting (Admin):

Account setting

In the account settings, enter your New Password, Password Confirmation, and your Current Password:

Enter new password, password confirmation and current password

After that, don’t forget to click Save.

Method 3: Reset Magento Admin Password Using PHPMyAdmin

Go to PHPMyAdmin, then copy the SQL query as follow:

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

The xxxxxxx character sequence is the cryptographic salt. Just replace them with your new password.

This command assumes that you want to change the password of the “admin” user. To change the password of other accounts, change the user name field to the correct value.

Here’re the articles you should read:
Magento Store Information: How to Set Up in Details
Magento Admin Panel: A Comprehensive Overview
How to Configure Magento 2 Admin Session Lifetime

Method 4: Reset Magento Admin Password Using Command Line

The final way to reset your password is by running the command line. In fact, Magento 2 CLI doesn’t support resetting the admin password, but we can create a new admin account and use this account to reset the lost password account.

So first, go to Magento 2 root folder and run the command below:

php bin/magento admin:user:create --admin-user=<your-admin-username> --admin-password=<your-admin-password>

Then, enter your email, first name, and last name.

After creating a new account, log in to the Magento admin dashboard and reset your lost password account using method 2.

To Wrap It up

Find it helpful? Save this article in case you lose your Magento 2 password. If you want to learn about Magento 2 store settings, visit our series here.

At Magezon, we also provide you with many fast, well-coded, yet affordable extensions for your Magento store optimization. Visit our website to opt for the necessary ones!

Optimize Your Magento Store With Powerful Extensions!

Looking for fast, efficient, and well-coded extensions to build or optimize your Magento stores for sales-boosting? Then visit the Magezon website and grab the necessary add-ons for yours today!

About Laura Cao

Laura Cao
Laura graduated from Foreign Trade University with a bachelor’s degree in Business English and is currently serving as a content marketer at Magezon. She indulges in reading and writing everything about Magento. In her spare time, gardening and hanging out with friends are her area of interest.

Check Also

magento-2-single-store-mode-01

How to Enable Magento 2 Single Store Mode

Previously in our Magento 2 tutorials series, you know that the Magento 2 scope feature …

Leave a Reply