Reset admin password in prestashop

45

If you’re like me and you tried the “lost password” link on prestashop’s backend and never received the email, you might try this solution if you have access to the database.  Look in config/settings.inc.php for the _COOKIE_KEY_ value as you’ll need that. Run the following SQL and replace the <> variables with your information.

UPDATE employee SET passwd = md5(“<_COOKIE_KEY_ value><yourNewPassword>”) WHERE email = “youremailaddress”;

hope that helps

Posted in: Prestashop
Tags:

This article has 45 comments

  1. citra 05/19/2009, 6:56 am:

    sir….your tips didn’t work for me. do you have another tips for me to reset my password for localhost installation….please help me. Thanks

  2. Atreyu 07/26/2009, 6:10 pm:

    Thanks so much, this worked great!

  3. xile 09/09/2009, 4:34 pm:

    With a few modifications this worked for me

    UPDATE ps_employee SET passwd = md5(‘Ak7HcvPQd2VLPRrMF2BW8s7AxPe43kOL0f5zY5BDTqb0YquGLxBCcMysadmin’) WHERE email =’my@email.com’

    The new password being “admin” which can be seen at the very end of the md5 checksum… Notice that single quotes are used instead of double quotes as in the first example…

  4. Prajake 12/08/2009, 10:32 am:

    Thank .. Soooo much for your useful PASSWORD SURVIVAL tip. Great :) and I wana tell Citra Pls.. Don’t copy ..
    md5(’Ak7HcvPQd2VLPRrMF2BW8s7AxPe43kOL0f5zY5BDTqb0YquGLxBCcMysadmin’) WHERE email =’my@email.com’
    and change only cookies and email,You must change all symbol ( ‘ ) in SQL statement before execute your SQL code too. It’s should work great…Thank again.

  5. Radu 12/14/2009, 5:13 am:

    With the modification made by xile it worked. Thanx !

  6. awebcreature 01/02/2010, 12:18 am:

    it’s work!
    Many thanks and Happy New Year !

  7. Richard Fort 01/09/2010, 6:09 pm:

    Excellent solution! I have been looking for other solutions but this is the best!

    Thanks!

  8. gadget4us 01/14/2010, 6:31 pm:

    well i do not understand where to put the sentences you mentioned.

    I allready see a cookiekey in settings.inc. I also seen by DB password.
    Should i put the words at the end?
    please let me know

  9. rami 02/10/2010, 9:24 am:

    it worked for me when i was do that:

    UPDATE ps_employee SET passwd = md5(“Ak7HcvPQd2VLPRrMF2BW8s7AxPe43kOL0f5zY5BDTqb0YquGLxBCcMysadmin”) WHERE email =”my@mail”

    (change of coarse the MD5 and the admin at the end to your settings)

    thanks man! you saved me!

  10. Dan Cunningham 04/14/2010, 4:36 am:

    Brilliant! I didnt realise that it needed the encyption key from the config.

    Worked a like a charm! :)

    Thanks Nick!

  11. pau 05/21/2010, 1:11 pm:

    Men, you saved my life.
    All the best from Barcelona (Spain)

  12. alex 05/29/2010, 4:39 am:

    thanks so much!!!!!!!!!!!!!

  13. Incense 06/11/2010, 3:26 am:

    The other way to change the password that works is:

    1) Register yourself on your store with the password that you want to be the admin password.

    2) Goto PhpMyAdmin >> Customer >> copy the password key from user ID you just registered.

    3) Goto PhpMyAdmin >> Employee >> paste the copied key on the password column of your admin ID.
    Ofcourse these are encrypted so you should not change anything while you copy paste.

    Thats it :)

    This trick works on most of the online softwares

    all the best!

    • gopi 07/31/2010, 7:55 am:

      thanks so much!!!!!!!!!!!!!
      cool dude it works

      • jordi 11/21/2010, 1:20 pm:

        Worked great, thanks a lot, you solved my last 20min headache :D

    • Cristi 08/18/2010, 11:27 am:

      Thakssss!!!!!
      copy paste rules….

    • Shawn 05/30/2011, 7:24 pm:

      The Best and Easiest Way,

      Thank you

    • Timothye 01/28/2012, 5:12 am:

      Yes mate , this worked perfectly .
      What a nice tip .
      100%
      Thanks a million . i was 2 seconds from deleting prestashop

    • Rick 02/13/2012, 6:15 pm:

      Awesome tip!!!! worked nice and easy, good job!

    • Mihai 09/21/2012, 1:12 am:

      Thanks a lot! It really works!

    • Mwangi 02/07/2013, 4:00 pm:

      bosss.. that was truly awesome..saved me alooot…. When in Kenya, Tusker on me!!

    • VjAlla 03/24/2013, 1:17 pm:

      The best and easiest solution. Its again proved that complex problems need not have complex solutions.

  14. wan 06/15/2010, 5:55 am:

    thank, its work great

  15. GacekSSJ4 06/28/2010, 4:53 am:

    Thank you for tip :)

  16. Hiren 08/20/2010, 2:18 am:

    Thanks a lot, very useful tip.

    Thanks again dude,

  17. Dan 10/14/2010, 1:19 am:

    Thanks man!

  18. Andres de los Reyes 10/15/2010, 10:04 am:

    Thanks man, you saved me

  19. lochot 10/20/2010, 4:38 am:

    thanks :)

  20. Mahmud 10/30/2010, 10:47 pm:

    Wow wow wow!!! absolutely mind blowing!!!! Great Job…u saved me a lot.

    Mahmud

  21. Tam Nguyen 12/27/2010, 1:43 pm:

    Yeah, i tried a lot but copy is the dimpliest way. Thanks!

  22. AlinX 01/24/2011, 7:31 am:

    You can try loggind in to the database and look for the table named ex. “ps_employee” without quotes and view it in some interface, in my case I used phpMyAdmin.
    Then, you can see your password encrypted in md5, so using Google for example, if you cannot encode yourself with other methods, you can use an online md5 encoder for example to make your new password “test” usable untill you can log in as administrator and cheange it to the one you wish.
    Using this kind of encoder I made the password “test” to look like this “098f6bcd4621d373cade4e832627b4f6″. You can use this one to login as password untill you change it.
    Good luck!

  23. Pablo 03/08/2011, 7:51 am:

    I cant make it work!, it doesnt work even bu running

    UPDATE ps_employee SET passwd = md5(Ak7HcvPQd2VLPRrMF2BW8s7AxPe43kOL0f5zY5BDTqb0YquGLxBCcMysadmin’) where email = ‘pablob@domain.com’

    also tried other passwords by copying password from a customer account, and didnt work. Even I tried with other employee account and i cant login, always get

    Error: employee does not exist, or bad password

    The smtp also seems not to be configured properly, and i cant get in to configure. Any help will be appreciated.

    Thanks

  24. Pablo 03/08/2011, 7:57 am:

    Sorry, but i didnt mention that now it seems to work, but it redirects to the login page, without any “employee does not exist, or bad password” error. What could that be the problem?

  25. vipul 03/27/2011, 9:11 pm:

    Thank you Xile!
    It worked….

  26. eBuildy 03/29/2011, 5:46 pm:

    Strange, why they are using MD5 instead of SHA1 ? MD5 is so deprecated now …

  27. Char Bennett 04/01/2011, 1:23 pm:

    Thank you for the php instructions – but im stuck on part 2. ” Goto PhpMyAdmin >> Employee >> paste the copied key on the password column of your admin ID.”

    I can not figure out where to go for this. If anyone can send me a little more detail I would truly appreciate it!

    • lies 05/05/2011, 11:39 am:

      can’t find it either. Is everyone here a genius or am I just stupid? Can’t find the files ‘customer’ and ‘employee’, and I don’t understand anything of the first explanation of nick. What do you do when you ‘run an sql’? Please give some explanation for dummies, I really need it!!

  28. Ed 04/11/2011, 12:41 pm:

    I love you! Worked a treat!

  29. lies 05/05/2011, 12:23 pm:

    please help me! I have prestashop installed locally, lost the admin password, but I really know NOTHING at all about sqls and stuff.

    Is there anyone who can explain step by step:
    1 which files I should open?
    2 where these files are located (my files are on D:/xampp/… and where do I look then?)
    3 which text I need to delete and which text I need to replace it with?

    Please!!!

  30. kyriakos 05/23/2011, 1:19 am:

    Hi all,
    I was trying to change the db pass for like 20 mins, when it hit me.
    For those that the SQL produces an error, just retype the double quotes and the query will execute just fine. The problem is that when you copy paste the query from here, directly to phpmyadmin, the double quotes are not recognized by it and it produces an error.

    • Jonas Kellander 06/22/2011, 3:47 pm:

      Hi!
      Great help, allso got stuck on the double quotes, retyped and now it all OK!

  31. prasanna majhee 06/30/2011, 5:25 am:

    hi
    thanks a lot for suggestion it works for me .
    and now i am continuing my website.

    • Manish Choudhary 08/31/2011, 6:17 am:

      You can change email address of the user and then click on the forgot passord link so that prestashop can generate new password.

  32. Tina O'Connell 08/03/2011, 7:58 am:

    I got this error when I did this and logged into the back office:
    Fatal error (Employee -> id_lang is empty) and nothing but that error and a white screen. Any ideas?

  33. charan 03/19/2013, 7:14 am:

    thanks its works fine

Leave a Reply

Your email address will not be published. Required fields are marked *

*




You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">