How to Change a PrestaShop Password via the Database and Cookie Key
Sometimes, as a PrestaShop store administrator, the standard methods of recovering or changing a password are not enough. Here is the database method. Sometimes, as the administrator of an online store built with PrestaShop, you may find yourself in a situation where the standard methods of recovering or changing a password are not enough. In such cases, changing the password directly through the database is an effective method. This guide will take you through the process step by step.
Prerequisites
Access to the Hosting Control Panel: You will need access to the control panel of the hosting where your PrestaShop site is located.
Database Management Tool: The most commonly used tool is phpMyAdmin, which allows easy manipulation of the database.
Cookie Key: This key is used to encrypt the password. You will find it in the settings.inc.php file in the config folder of your PrestaShop installation.
Step 1: Finding the Cookie Key
Log in to the hosting control panel. Open the file manager and go to the folder where your PrestaShop is installed. Find the config folder and the settings.inc.php file inside it. Find the line containing _COOKIE_KEY_. You will need the value of the cookie key for the next steps.Step 2: Accessing the Database
In the hosting control panel, find and open phpMyAdmin or another database management tool. Select the database used by your PrestaShop store.Step 3: Changing the Password
In the database, find the ps_employee table (the ps_ prefix may differ depending on the configuration). Find your record in the table, usually identified by your e-mail address. Prepare the new password. Use the MD5 encryption function combined with the cookie key: MD5(_COOKIE_KEY_ your_password). You can use any online tool to generate this encrypted password. Edit the record and paste the new encrypted password into the passwd field. A short video showing how it looks: You can also enter the following in the SQL field:UPDATE `ps_employee` SET `passwd` = MD5('geddGtxKVv1NynozeUoRx23Hgn0rP4rGk4Q9wVvN0TDGzmPtvXSBC8ktPassword') WHERE `ps_employee`.`id_employee` = 1;
Where the underlined part is your cookie key from the file, and the bold part is the new password you want to save. id_employee is the ID number of the account whose password you want to change.
Step 4: Testing the Changes
After changing the password, try logging in to the PrestaShop admin panel using the new password. If the login succeeds, it means the password change went through successfully.
Final Notes
Security: Always remember to keep your data secure. Do not share your cookie key or your new password with third parties. Backup: It is recommended to make a backup of the database before making any changes. PrestaShop Updates: Changes in the database may be overwritten when the PrestaShop system is updated, so keep this in mind. Following this guide should allow you to safely change a password in the PrestaShop system when the standard methods fail. Remember, however, that manipulating the database carries risk and should be done carefully.Get notified about new articles
Subscribe by e-mail or turn on browser notifications — we only send new blog posts, nothing else.


Comments
No comment at this time!
Leave your comment