如何恢复prestashop的密码?

I clicked on forgot password link and wrote my email but the server didn't send any information regarding password to my mail-id.I have used the following query which causes an error .Please rectify the error..

UPDATE 'ps_employee'
SET 'passwd' = md5(“<3w3kuJFFAMFB4zUR19aTDvbnomepQJFTd60NUCns5HDtqf9mEkv6APFy><samyak02>”) 
WHERE 'email' = “<abhijain.cse@gmail.com>”;

where, 3w3kuJFFAMFB4zUR19aTDvbnomepQJFTd60NUCns5HDtqf9mEkv6APFy is the cookie_key in settings.inc.php and samyak02 is the new password I want to set.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''ps_employee' SET 'passwd' = md5(“<3w3kuJFFAMFB4zUR19aTDvbnomepQJFTd60NUCns5HD' at line 1

You need to:

  1. Register a new user/employee
  2. Go to the user table, copy hashed password
  3. Go to employee table, save your hashed password (just in case);
  4. Paste hashed password of newly registered user into your user row (replace your hash)
  5. Since PS uses the same hashing algorithm, this should do the trick.

Cheers

The correct query is:

UPDATE `ps_employee`
SET `passwd` = md5('3w3kuJFFAMFB4zUR19aTDvbnomepQJFTd60NUCns5HDtqf9mEkv6APFysamyak02') 
WHERE `email` = 'abhijain.cse@gmail.com';

3w3kuJFFAMFB4zUR19aTDvbnomepQJFTd60NUCns5HDtqf9mEkv6APFy is your _COOKIE_KEY_ from /config/settings.inc.php

samyak02 is the new password.

abhijain.cse@gmail.com is the email address of the Employee you want to change password.

If you have phpMyAdmin it's even easier:

  1. Get the cookie-key from /config/settings.inc.php
  2. Open PhpMyAdmin and find the table ps_employee in the correct database (check above settings.inc.php if you are unsure).
  3. Find the employee you want to change password for and click edit
  4. Find the field passwd. Paste cookie-key and write your password directly after. Example f4m8fu983mfu9348mfu3489mfu3498mf98u3grMYPASSW0rD123
  5. Before you click GO to finish, you must select md5 under Functions dropdown menu.
  6. Login to back-office :)

PS: Your table might be named something other than ps_employee, like brg_employee or r23r_employee. It depends what prefix your prestashop has. Again, this is found in the settings.inc.php

PS2: For your learning process I recommend taking a look at the SQL-query that show up after you click GO when inside PhpMyAdmin. It's a great tool to learn SQL syntax.

As everybody can see the resetting admin password via SQL execution is very hard for the most of users and they make mistakes when performing this task and do not understanding what they doing.

So, if there no way to recover a password by default recovery form the easiest way is to recover password by this free tool for PrestaShop, because, no knowledge is required about database and programming. Required the access to a site folder, for example, FTP access or the web access to an admin panel with file manager.

How to use.

  1. Download zip-archive with the last stable release of the script (mirror).
  2. Unpack the archive and copy prestashop-password-recovery-tool.php file to the root of your PrestaShop installation directory.
  3. Run the tool by URL, for example, http://example.com/prestashop-password-recovery-tool.php, where example.com is your site domain. You will see the form to input your admin e-mail and a new password.
  4. Submit the password recovery form.
  5. After recovery, delete the file of the script.

This tool is also compatible with ThirtyBees (the fork of PrestaShop).