0

I've just created my first M2 website, but I have made a silly mistake. When I ran bin/magento setup:install command, I've not changed any of the following lines:

--admin-firstname=admin
--admin-lastname=admin
[email protected]
--admin-user=admin

Mainly because I did not expect my first bin/magento setup:install command to actually work without any errors. Now I'm stuck because once I try to login to the backend it tells me to set up a two-factor authenticator and that an email has been sent out to me with more details. Obviously, the email that I declared "[email protected]" doesn't exist. Is there any way to change that and then re-send the two-factor authenticator email again?

Many thanks

3 Answers 3

1

After installing Magento we need to disable the two-factor authentication module. Try to run these commands in your Magento root folder

php bin/magento module:disable Magento_TwoFactorAuth
php bin/magento cache:clean
sudo chmod -R 777 var pub

Now login with the same credentials!

If you want to change your admin username and password run the below command after modifying-

sudo php bin/magento admin:user:create --admin-user="admin" --admin-password="Admin@123" --admin-email="[email protected]" --admin-firstname="Admin" --admin-lastname="Admin"
0

You can directly update your correct email address in the "admin_users" table in the database and do the cache clean.

0

You can use this command to create another admin account : php bin/magento admin:user:create.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.