Create or update admin user in magento2 using CMD - Magesan

Create or update admin user in magento2 using CMD

Create or update admin user in magento2 using CMD

Magento2 admin user are somewhat tricky things when you forgot their passwords or username while login.

Following command allows you to create new user or if you know the username then update to that user’s password

  1. Creating new user using cmd
php bin/magento admin:user:create --admin-user=admin --admin-password=admin@123 --admin-email=test@gmail.com --admin-firstname=admin --admin-lastname=admin

2. Updating an existing user using database.

UPDATE admin_user SET `password` = CONCAT(SHA2('xxxxxxxxadmin@123', 256), ':xxxxxxxx:1') WHERE username = 'admin';

Leave a Reply

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

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>