Recovering the Adminiastrator's Password

Updated on Dec 10, 2015

Not always but sometimes you might find yourself lost due to the fact that you have lost your admin password and you cannot login into your Store's backend to perform some critical change. In such cases you are wondering, how am I supposed to reset the password or change it to something else so I can login?

The answer to that question can be found in this tutorial as we will illustrate two ways of changing your admin password so you can restore the control on your Store.

To recover your Admin Password, you need to either:

option

Use the Lost Password Feature

As the name of this option suggest your Store have the option to recover lost password. The only thing you need to do is head over to your Store's admin backend login page and click the Lost Password? link.

recovering-password

You will be redirected to almost the same form, however this time you will need only to input your email address so the application can send you a new password for your admin user. Once you enter your email address and press the Send button you will be prompted with a message informing that the password has been sent successfully.

password-emailed

If you check your email you will find a new message informing you about your new password similar or the same as the following:

password-recovery-email

As you can see your new password is in that message and the only thing left to do is to login into your Store's backend with the new password.

option

Change the Password in the Database

This option is quite more time consuming and it will require some additional knowledge in databases and your Store's file system. However if you follow the outlined information bellow you will be able to easily change the password even without such knowledge.

  • You will need to know what is the name of your database. This can be easily found in the configuration file of your application. The file in question can be found in the settings.inc.php file located inside the config folder of your Store's file structure.

The best way to view this file is if you download it using the FTP service.

finding-the-configuration-file

Once you download this file, open it with your favorite text editor (Such as notepad++ or just notepad) and search for the following line in it:

define('_DB_NAME_', 'example_database');

The "example_database" string should be the name of your database and it will be different depending on the database name used for the installation of your Store.

Another line you will need from the same file is the following line:

define('_COOKIE_KEY_', 'rTWLam5so71CrvrjzcMgjMGuypvk61yC5Y95C13q3A3yHXTwgGLbmibS');

The calue of the "_COOKIE_KEY_" will be different as it is random and unique sting for each Store.

Once you know your database name and your cookie key you will be able to change the password via your database. In order to edit the required field however you will need to find it.

  • Login into your cPanel and click on the phpMyAdmin icon in order to access the phpMyAdmin application.

cPanel-phpMyAdmin

  • Once there, select your database and find the table "ps_employee". Note that the table prefix (ps_; in this case) might defer depending on what prefix you have chosen during the installation process.

Once you find the table click on it and you will be presented with a list of the employees you have added to your shop. Find the one which is either with lowest "id_employee" or the one having your email address as value for the email column.

editing-table-row

Use the Edit link so you can access the editing interface for this record. There you should search for a field called passwd.

editing-the-password

Once you find the passwd column you will need to choose the MD5 function from the Function drop-down list and to insert the cookie key followed directly by the value for your new password.

For example if your cookie key is rTWLam5so71CrvrjzcMgjMGuypvk61yC5Y95C13q3A3yHXTwgGLbmibS and your password is pass123 the sting you will need to insert in the field is:

rTWLam5so71CrvrjzcMgjMGuypvk61yC5Y95C13q3A3yHXTwgGLbmibSpass123

Once you fill this field simply click the Go button for the query to your database to be executed and your new password will be active already so you can login into the backend of your Store.

Congratulations! You can now safely recover the password for your admin user!

On this page...

    PrestaShop Hosting

    • Free Installation
    • 24/7 Tech Support
    • Free Domain Transfer
    • Hack-free Protection
    • Fast SSD Storage
    • Free CloudFlare CDN
    • Free Website Transfer
    • Immediate Activation
    View More