admin/ March 25, 2016/ Linux, Magento2/ 0 comments

How to change magento2 admin password?

First you need to get to the path of your magento2 instance.

 $ cd /var/www/html/ 

Connect with the database using in magento2 instance. Please check the database name at app/etc/env.php.

$ nano app/etc/env.php 

login into mysql using phpmyadmin or any mysql client.

Connect mysql with terminal, follow the below commands-:

 $ mysql -u USERNAME -pPassword 
 mysql> Use database < Database Name >; 

Use the below sql query to get username and email to change the password .

 mysql> SELECT username, email FROM `admin_user` 
 mysql> exit; 

Use the below command to change the admin password

 $ php5 bin/magento admin:user:create --admin-user="admin" --admin-password="[email protected]" --admin-email="[email protected]" --admin-firstname="magento" --admin-lastname="2" 

Note -: Email id is required to change the password of required user of magento2 admin.


Share this Post

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.