Home » Interview Question » How to reset admin password in Magento 2

How to reset admin password in Magento 2

How to reset admin password in Magento 2

Method 1 : From Magento 2 user Interface

Some time user forgot admin password, to get the admin password magneto provide the user Interface. To get the password click on forgot password and provide the username or email id and click on Retrieve Password.

  1. If username and enter email id is correct you will receive an email containing a link to confirm the password reset. Click this link to get the password reset page.
  2. In the New Password and Confirm New Password fields, enter the same password, then click Reset Password button.
  3. Now you got the successful change password message after click on reset button.
  4. Now go to admin url and login with new credentials.

Note: If you got error message"You Did not Sign in Correctly or Your Account is Temporarily Disabled Magento 2"
first you need to unblock your admin account.

Method 2 : Reset Magento 2 admin password in PhpMyAdmin

To reset Magneto 2 admin password from PhpMyAdmin or Mysql interface follow below steps.
Open PhpMyAdmin sql command line tab/or command prompt and Go to PhpMyAdmin and Run the following sql query:

Where "xxxxxxx" character is a cryptographic salt(You can got cryptographic salt from below files).

cryptographic salt file Path: app\etc\env.php 

Just Like My cryptographic salt is “5a9ef25c28ff94a5bf35b8f9934c92d9″ so My update query is

So My update query is 

Now go to admin url and login with new credentials.

Method 3: Command Line Interface(CLI)

Before to processed this method you must have SSH access to your server. If you do not have SSH access, provide the SSH access.

  1. Log in to your server with SSH or if you have work on local environment.
  2. Go to command prompt(Run->cmd)
  3. Go to Magento 2 root directory
  4. D:\Xamp\htdocs\magento2> Before run below command change the user name, Password, email first name and last name. 

Note: admin user and admin-email values both need to match an existing user or both be new.
Now go to admin url and login with new credentials.

, , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">