How to create new Admin user to Magento via PHPmyadmin or MySQL command

Sometimes you forget your Magento admin username, password or even registered email for Magento admin user, how do we create another admin user without access to Magento backend?

In this case, Forgot password function of Magento will not work as you forgot admin email, we will need to do something with Magento database.

Step 1

Go to your PHPmyadmin tool in hosting cpanel

Next, login to PHPmyadmin with mysql username and password you are using for Magento site, if you forgot this, go to app/etc/local.xml and find these line

In this example, “root” is mysql username and “password” is mysql password. Now use these details to login to PHPmyadmin

Step 2

In phpmyadmin, select the database you are using for your site, in this example: magento

Select SQL tab and execute the following SQL command

Put this command to SQL and click on go

After the query is executed, you will see this result message

This mean you succeeded to add new Magento admin user

Running SQL command via Magento CLI

If you have shell access to your VPS/server, you can use the following command:

Next, execute this command line by line (replace values same as PHPmyadmin)

Step 3

Go to and use the newly created admin account

In this example:

  • Username: brian
  • Password: Magento123456@


Leave a Reply

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