How to reset Admin password using phpMyAdmin in Magento


Sometimes you forget your Magento Admin password and you don’t know how to reset or recover it? This magento tutorial will guide you step by step how to set a new password for your Admin account using phpMyAdmin.

Step 1: Access phpMyAdmin tool

If you are using Cpanel, you can access phpMyAdmin in Database section


access phpmyadmin cpanel

In case you’re not using Cpanel, you can access phpMyAdmin directly from your domain, just follow these steps:

– Download latest compatible phpMyadmin version at:

– Exact the compressed package, upload the files to your desired path, for example, if your site’s folder is Public_html you can upload to:  public_html/phpmyadmin/

– Next, access phpMyAdmin directly from this url:

phpmyadmin magento password


Note:(sometimes you cannot access phpmyadmin due to htaccess file, just temporarily rename/remove the file to access phpmyadmin)

– Now login using Cpanel account info or any mysql user you created.

Step 2: Access database

Now select the database of your site on the left side

choose the database in phpmyadmin magento password

Step 3: Create new admin account for Magento site

After that, click on the SQL tab in and execute the following MySQL query:

sql querry to retrieve password magento admin

Change the following variables:

admin_user – this is database table from the Magento database. Check if this table have a prefix , such as “bk_“, you need to replace the admin_user name with the correct database table name, i.e. bk_admin_user.

NEWPASSWORD – the new password which you want to set.

ADMINUSERNAME – Magento admin username, i.e. admin.

Click on Go button to run the query and your new admin account will be set.

*if you see many databases in phpMyadmin and not sure which one is being used on your site, open the following file:


And search for the following line:

user_magedatabase is the name of the database of your Magento site

Everything is done, now just login with the newly created admin account.

If you have any questions or problems just feel free to drop a line here. I’m grateful to help you out.

Rate this post


About Author

Brian is a Magento developer with 5 years of experience with customizing Magento extensions, Magento templates. He's main author at Magento explorer


  1. Hi

    My magento site has been hacked and i am unable to get access to the cpanel

    I have read the post on how to reset the passsworkd using phpmyadmin but i am still confused

    please can you help

    • Hello ASAM,
      What step are you confusing at? First you need to login to PHPmyadmin of your hosting. Then follow the step in the article to run the query in the article.
      Replace username & password as you want.
      Let me know if you need any help

Leave A Reply