Hello Magento Friends,

Today we are going to learn How to Reset Magento 2 Admin Password.

Having a strong password for any store or account is necessary to save your store from unauthorized access. And having a strong password for your admin panel is also one of the important things. Your password should be unique, and for others, it should be hard to know the trick.

But what happens when you forget that unique hard-to-follow password of your admin panel? You most certainly won’t be able to sign in to your admin account.

Therefore, today I am going to tell you all not to worry too much because we have got you covered. I have come up with a few ways you can use to reset your admin password. Below are the methods you can easily implement to retrieve the control of your admin panel.

Method-1: Reset Magento 2 Admin Password using Forgot Password

It is the most common and general method you can use to reset the password.

Step 1: Go to the Magento Admin login page.

Step 2: Click on Forgot password.

Step 3: Enter Email and click Recover Password.

Step 4: If cron is properly set up and Emails are working fine, then you will receive an email to reset the password for your admin user.

magento 2 password reset

Method – 2: Reset Magento 2 Admin Password using Account Settings

You can even reset Magento 2 Admin Password from the Account Settings in the backend.

Step 1: Log in to Magento Admin Panel.

Step 2: Go to Account Setting as shown in the figure.

account setting

Step 3: Next, Enter the New Password.

Step 4: Enter the new password again in the Password Confirmation field.

Step 5: Enter your old password in the Your Password field.

Step 6: Then, click on Save Account.

reset password

Method- 3: Reset Magento 2 Admin Password using Database

Let’s assume that you don’t have access to your Email id, but you can access the database, then you need to follow this method.

Go to phpMyAdmin and copy the following SQL query:

Note: The xxxxxxx character sequence is a cryptographic salt, you can find it in the app\etc\env.php file.

See below:

Method – 4: Reset Magento 2 Admin Password using Command Line (CLI)

Connect Your server with SSH – then go to Magento Root Folder and run the below command to create a new user,

It should ask you for some information like username, password, email, first name, and last name.

For Example:

That’s it, and your new admin user with username magecomp is created.

You can also run the below command with all the information passing in one command string.

Bonus Tip: In rare cases, if the admin user is locked out, then you can run the following command to unlock it.


Using any one of the above methods, you can reset your admin password and can save your Magento store from getting into the hands of fraudsters. So, this was all for today. I will be back again with new exciting Magneto news and tutorials. Till then, keep reading the Magento tutorial series.

If you liked this tutorial, then give it a thumbs-up and let us know what you liked the most in the comments. Also, please share this with your Magento colleague and friend to let them know.

Lastly, if you had any problem while implementing these methods or need any help with your Magento store, then you can contact our Support Desk. We will be happy to help you.

P.S. If you want me to write on a topic that you are facing a problem with your Magento then let me know in the comments, we will try our best to provide you with a workable solution.

Click to rate this post!
[Total: 11 Average: 5]