In this article, We will show you How to Reset Magento 2 Admin Password. If you forget the admin password then, You need a way to reset your password.
Today we will show you some tricks for reset your password when your account will lock. Let’s follow steps to reset your admin password. There are three different methods that are available to change the password.
1. Reset Password using Admin
Follow the below steps to Change Magento 2 admin password using Admin Panel,
Note: This method only works if you don’t forget your old password.
– Log in to Admin Panel
– Go to Account Settings
– Enter the new password
– Add a new password again to confirm the change password.
– Enter your old password to confirm your identity.
– Save Accounts
2. Reset Password using Email
Follow the below steps to Change Magento 2 admin password using the default recovery system,
– Go to Admin Login Page
– Click the Forgot your password link
– Enter the Email address and click the Retrieve password button.
– Set a new password with the Reset Password link received in the Email.
3. Reset Password using Command line
Open the terminal and go to Magento root directory and execute the below command to change your password,
php bin/magento admin:user:create --admin-user="yourusername" --admin-password="YourPassword" --admin-email="firstname.lastname@example.org" --admin-firstname="WebEcoms" --admin-lastname="Admin"
4. Reset Password using Phpmyadmin
– Login to Phpmyadmin and run the below query to change password,
UPDATE admin_user SET password = SHA2('YourPassword', 256) WHERE username='yourusername';
– Another query to change password,
UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxYourPassword', 256), ':xxxxxxx:1') WHERE username = 'yourusername';
If you want to use this method then you need to get the crypt key which you find in the app/etc/env.php file,
<?php return [ 'backend' => [ 'frontName' => 'admin' ], 'crypt' => [ 'key' => '91668adf4748b0017494a2bd57d1ae67' ],
Replace this key at xxxxxxx in the query and execute this query.
That’s it. These four steps will be useful for reset your admin password in different ways.
We hope this article about How to Reset Magento 2 Admin Password is helpful. If you have any questions about the article feel free to comment below. We will get back to you with an answer.