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:


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 "admin@admin.com" doesn't exist. Is there any way to change that and then re-send the two-factor authenticator email again?

Many thanks


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="admin@example.com" --admin-firstname="Admin" --admin-lastname="Admin"

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


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, privacy policy and cookie policy

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