How to change Magento 2 Admin password?
By default, Magento 2 encrypts owner’s password using SHA-256 algorithm (have in mind that encryption methods can vary from version to version). The measures are taken to eliminate hackers ability to penetrate into your store database and stole the password. Thus, if you have forgotten the password, it can only be replaced with a new one, which in its turn will also be encrypted during the process.
Change Admin Password through phpMyAdmin
- Log in to your cPanel in case it’s installed;
- Go to the ‘Database’ section and choose the phpMyAdmin link:
- Select Magento database from the left phpMyAdmin panel. Magento database is usually named username_mageXXX where XXX are three digits;
- You will see a list of tables, choose the ‘SQL’ option in the top menu:
- Copy the line into the SQL query:
UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxxNewPassword', 256), ':xxxxxxxx:1') WHERE username = ‘admin';
- Change the xxxxxxxx with a new password;
- Click the ‘Go’ button to confirm the changes.
Change Admin Password via email
The admin password can be recovered with the default recovery system. Go to your Admin Panel and choose the ‘Forgot your password?’ link. Put in your email address and click the Retrieve Password button:
You will be sent a link following which you will manage to reset a current password: