Skip to content

How to Reset the Magento Admin Password: Four Effective Methods

Magento stands out as a leading e-commerce platform, renowned for its robustness and versatility. Yet, like all systems, users might occasionally find themselves in a situation where they’ve forgotten or misplaced their Magento Admin Password. If you’re in this predicament, don’t fret. Magento has built-in solutions to help you reset it. This article delves into four effective methods to reset the Magento Admin Password and regain access to your online store.

1. Resetting Magento Admin Password Using Magento CLI

The Command Line Interface (CLI) of Magento is a potent tool designed for administrators. It facilitates the management of diverse store aspects, including user management.

Steps to Reset the Magento Admin Password via CLI

  1. Launch the terminal or command prompt.
  2. Direct yourself to your Magento installation’s root.
  3. Input the following command:
php bin/magento admin:user:create --admin-user="admin" --admin-password="123123q" --admin-email="" --admin-firstname="Admin" --admin-lastname="Admin"

2. Resetting Magento Admin Password Directly from the Database

For those with database access to their Magento store, the Magento Admin Password can be reset directly.

Steps to Reset the Magento Admin Password from the Database

  1. Open PhpMyAdmin or your chosen database manager.
  2. Seek out the admin_user table.
  3. Implement the subsequent SQL command:
UPDATE admin_user SET `password` = SHA2('YourDesiredPassword', 256) WHERE `username`='admin';

3. Advanced SQL Queries for Magento Admin Password Reset

For tech-savvy individuals, utilizing advanced SQL commands can be the route to go.

Steps for Magento Admin Password Reset via Advanced SQL

  1. Access your store’s database.
  2. Execute the following commands
UPDATE admin_user SET password = CONCAT(SHA2(CONCAT(@salt, 'YourDesiredPassword'), 256), ':', @salt, ':1') WHERE username = 'admin';

4. N98-Magerun Tool for Magento Admin Password Recovery

N98-Magerun, a third-party utility, boasts a plethora of features for Magento store management, notably the Magento Admin Password reset.

Steps using N98-Magerun

  1. Download and integrate N98-Magerun into your Magento project’s root.
  2. Launch the terminal and head to your Magento installation’s root.
  3. Run the command:
php n98-magerun2.phar admin:user:change-password

Adhere to the on-screen directives to finalize the process