27 May
2024
Below is a step-by-step guide on how to reset the administrator password (or any user password) in PrestaShop when the built-in password recovery no longer works.
The only requirement is to have access to your web hosting through cPanel or Plesk.
STEP 1. Access phpMyAdmin
Log in to your hosting control panel (cPanel or Plesk) and locate the phpMyAdmin tool.
You need access to this section in order to manage your eCommerce database.
Look for phpMyAdmin or the Databases section (especially in Plesk).
Find the database used by your PrestaShop store and click the icon to open phpMyAdmin.
STEP 2. Open the administrators table
On the left sidebar, phpMyAdmin will display all tables inside your selected database.
The table you need is usually called ps_employee.
The prefix (ps_) may vary depending on your PrestaShop installation.
Click the ps_employee table and locate the record that belongs to the administrator.
This is usually the user with ID 1 or the admin username you recognize.
STEP 3. Prepare to update the password
Click the Edit button next to the administrator record.
Locate the passwd field.
Since PrestaShop stores passwords as hashed values, you must generate a new valid hash for the new password.
STEP 4. Retrieve the PrestaShop cookie key
PrestaShop uses MD5 hashing combined with a salt key.
You must create an MD5 hash of your new password combined with the _COOKIE_KEY_ value from the settings.inc.php file.
Connect via FTP and navigate to the folder:
app/config/
Inside that path, open the file settings.inc.php and locate the value:
'cookie_key' => 'XXXXXX'
Copy the cookie key value somewhere safe.
STEP 5. Generate the new password hash
Create a new plain text file on your computer and paste the following PHP code: