How to create admin user using command line in magento 2?

How to create admin user using CLI in Magento 2? – Some times we need to create admin users without login to Magento admin panel. We can use the command line to create admin users. This is something pretty simple to achieve.

Run the below command from the root directory.

You will get the prompt to give Admin user, Admin Password, Admin Email, Admin first Name, Admin Last Name one by one respectively after filling each. Once everything filled successfully you will get the success message of ” Created Magento administrator user named username “.

create admin using Command line
create admin using Command line

After cache flush, you can use the created credential to log in to the admin panel. In this way, we can create admin user using CLI in Magento 2.

To read more articles one Magento visit Magento 2, GraphQl.

Leave a Reply

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