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
- 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';