In this tutorial, Today I will explain to you how to reset admin password in Magento 2. If you need to login in admin then, you need to have username and password in Magento 2. But, The problem is that if you forget admin password then, how to reset admin password? There are “Forgot your password” link available and after click on that you will receive email and change password.
This tutorial will helpful for you when your account will lock and need to reset password. Let’s follow steps to reset admin password in Magento 2.
You may also like this :
Step 1 : Reset admin password by phpmyadmin
Go to phpmyadmin and copy this below query :
UPDATE admin_user SET password = SHA2('NewPassword', 256) WHERE username='admin';
or
UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxYourNewPassword', 256), ':xxxxxxx:1') WHERE username = 'admin';
If you want to execute 2nd query then, you need to get crypt key from app/etc/env.php
<?php
return [
'backend' => [
'frontName' => 'admin'
],
'crypt' => [
'key' => 'eeca94d9668b46a32f1d4ebee472f724'
],
Replace this key at xxxxxxx in 2nd query and execute this query.
Step 2 : Reset admin password by command line
Open terminal and go to Magento root directory and execute this below command :
php bin/magento admin:user:create --admin-user="admin" --admin-password="admin123" --admin-email="admin@example.com" --admin-firstname="Admin" --admin-lastname="Admin"
Step 3 : Reset admin password by Account Settings
- Login to Admin Panel
- Go to Account Settings
- Enter the new password
- Add new password again to confirm the change password.
- Enter your old password to confirm your identity.
- Save Accounts
Step 4 : Reset admin password by email
- Change Magento 2 admin password using the default recovery system.
- Go to Admin Panel
- Click the Forgot your password link
- Enter the Email address and click the Retrieve password button.
- Set new password with the Reset Password link received in the Email.
These four steps will be useful for reset your admin password by different ways.
That’s it !!
I hope this blog is easy to understand about how to reset admin password in Magento 2. In case, I missed anything or need to add some information, always feel free to leave a comment in this blog, I’ll get back with proper solution.
Keep liking and sharing 🙂