How To Reset Admin Password in Magento

You can reset your Magento administrative password directly through the database related to your website application. You can access the database through cPanel -> phpMyAdmin tool.

Once you have opened the phpMyAdmin tool choose the corresponding database* from the dropdown menu on the left side. After that click on the SQL tab in order to be able to execute the following MySQL query. Note that the query will differ depending on the Magento version you have:

For Magento 1.9 and older

For Magento 2:

where:

admin_user - this is database table from the Magento database. Bear in mind that this table may have a prefix such as "mg_" or different one. You will see the prefix of the database once you access the phpMyAdmin tool and select the database. The database tables will be listed and you will see if there is a database prefix or not. If there is a prefix you should replace the admin_user name with the correct database table name, i.e. mg_admin_user.

NewPassword - the desired password which you want to be set. The x..x character sequence is a cryptographic salt. It can be anything you want, but make sure you use the same value in both parts of the SQL statement.

ADMINUSERNAME - your Magento administrative username, i.e. admin.

Execute the query and your new password will be set.

*If you are not sure exactly which database is related to your website you can find its name inside the following file:

~/app/etc/local.xml

You can open the file through cPanel -> File manager and search for the following line:

where user_magedatabase is the name of the database.

You need help with a shopping cart? SiteGround is specialized in eCommerce hosting and provides expert support for a large number of shopping carts. Check out our shopping cart hosting services!