Jump to content

Forgotten / Lost Password - Manual Reset via phpMyAdmin


Recommended Posts

I tried to do this following the instructions here and it kept on failing. I have run into this problem before with a CMS that I created on my own.

I have noticed that when you try and run an md5 through MySQL the result sometimes be different than if you do it via PHP, although you won't notice anything besides failed login attempts with the new password. I think what really happens is that the syntax gets messed up or there are errors between copying and pasting / extra white space characters (ie. there is either a leading or trailing space that you may not notice). By the very nature of running a hash the values should be the same from SQL or PHP, it shouldn't matter.

So after screwing around trying to do it with SQL I went ahead and created a simple PHP script to create the correct hash and it worked.

See attached file for the script... follow the commented instructions.


Good Luck!

prestashop_pword_hash.php

  • Like 6
Link to comment
Share on other sites

  • 5 months later...
  • 9 months later...
  • 1 month later...

It worked perfectly for me! Thanks!

 

I found this somewehre else and it worked.

UPDATE `ps_employee` SET `passwd` = MD5('<_COOKIE_>password') WHERE `ps_employee`.`id_employee` = 1;

Where cookie is from config file and password is the password you want.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 3 weeks later...
  • 4 weeks later...

guys i'm having exactly the same problem, but i can't fix it with the above instructions. i've even tried the php script. i am able to execute the query with no problem, but the login problem remains. any other ideas? this si the sql sintax of my command:

 

UPDATE ps_employee SET passwd=md5('ILGE3SN1jaNM6hErPDYPBWgCBPpOSBYfaxfJsikAcMimaJF5ZwJPhwQz123456789') WHERE `id_employee`=3;

 

it runs successfully but does not solve the problem. i have also tried with 'email' instead of 'id_employee'.

 

please help!

Link to comment
Share on other sites

guys i'm having exactly the same problem, but i can't fix it with the above instructions. i've even tried the php script. i am able to execute the query with no problem, but the login problem remains. any other ideas? this si the sql sintax of my command:

 

UPDATE ps_employee SET passwd=md5('ILGE3SN1jaNM6hErPDYPBWgCBPpOSBYfaxfJsikAcMimaJF5ZwJPhwQz123456789') WHERE `id_employee`=3;

 

it runs successfully but does not solve the problem. i have also tried with 'email' instead of 'id_employee'.

 

please help!

Link to comment
Share on other sites

  • 5 months later...
  • 11 months later...

Somewhere in the post it is written that

I found this somewehre else and it worked.

 

UPDATE `ps_employee` SET `passwd` = MD5('<_COOKIE_>password') WHERE `ps_employee`.`id_employee` = 1;

 

Where cookie is from config file and password is the password you want.

 

For me the following worked

 

UPDATE `ps_employee` SET `passwd` = MD5('<_COOKIE_KEY_>mypassword') WHERE `ps_employee`.`id_employee` = 1;

 

Here _COOKIE_KEY_ could be found in config/settings.inc.php. I am working on version 1.5.x, I didn't find COOKIE var in config.php probably in older versions it was there? But for 1.5.x you should probably find in settings.inc.php

 

Thanks

 

http://www.regur.net

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...

just wanted to point out because it took me some time ...

in --> UPDATE `ps_employee` SET `passwd` = MD5('<_COOKIE_KEY_>mypassword') WHERE `ps_employee`.`id_employee` = 1;

totally replace <_COOKIE_KEY_> with _COOKIE_KEY_ value found in  config/settings.inc.php 

and put in what ever password you want instead of mypassword.

also take not that this is for id_employee` = 1 so you need to log in with the email address of employee 1

Link to comment
Share on other sites

  • 1 month later...

tried this:

 

UPDATE `ps_employee` SET `passwd` = MD5(1qUaR5hfmNyjwKFrIBXo95CfSBQt8QMUmYkdAifzXaV9cqqH3UPhMuxq'rohit') WHERE `ps_employee`.`id_employee` = 2;

 

Got this:

 

SQL query:

UPDATE `ps_employee` SET `passwd` = MD5( 1qUaR5hfmNyjwKFrIBXo95CfSBQt8QMUmYkdAifzXaV9cqqH3UPhMuxq 'rohit' ) WHERE `ps_employee`.`id_employee` =2

MySQL said: b_help.png

#1583 - Incorrect parameters in the call to native function 'MD5'
Link to comment
Share on other sites

  • 4 months later...
  • 3 weeks later...

thank you for explanation :-)

yea, for everyone with question marks in head what is cookie key

 

open /config/settings.inc.php file

there is declaration of constant COOKIE_KEY

and it's value is a cookie key to include to query janilson proposed to use

Link to comment
Share on other sites

  • 2 months later...
  • 2 years later...

Just create a normal account (client account) via the frontend of the shop. go to the mysql database, copy the password of the new created client account from ps_customer to your employee account row in ps_employee and your good to go =)

Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...

The new way (probably starting from 1.7.4) uses Bcrypt. You can generate the password here:
https://passwordhashing.com/BCrypt

And then copy the cypher text  directly to employees.passwd 

As simple as that. No need to concatenate the cookie key anymore.
This is how Laravel handles it and probably the best practice nowadays. 

Edited by Mercader Virtual (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
2 hours ago, KILIYATSIA said:

lost the password to the admin page. I read the replies but they are too advanced for me. I what is PHPMYADMIN and where can I find it?

My question is this: How do I find or reset the address to go to my admin page?

I would be grateful for any help

Which prestashop version?

Link to comment
Share on other sites

  • 2 years later...
  • 2 months later...
  • 5 months later...

Hello All,

I had lost my password too, I am using a local host.

What I did was: (solutions)

1. I open classes/employee.php

2. add line 329 : echo $crypto->hash($plaintextPassword); exit;

3. Go on the browser Put your email and password, don't click login

4. right click, choose inspect, choose responses, and copy the data in responses

5. Paste it in PHPMyAdmin, [your database name]/ps_employee in passwd, and press enter to save

6. Now go on browser and click on the login 

7. Works like magic

image.thumb.png.7e2055472b332333565cc17d66f3da4c.png

~Mehnoor

 

Edited by endriu107 (see edit history)
  • Thanks 1
Link to comment
Share on other sites

Hello 

@mehnoor 's solution is great.  I can make it simpler for you.

Start from number 5 and paste the below text on the password field of your [your database name]/[DB_PREFIX]employee table

$2y$10$Z2y3bYcBksYiGkYReov8Iu/xZ6oJJmRtdsoJ5DK7NjniF1rfg9Ukm 

The above encoded code represents password: 123456789

Log in and then you will be able to change the password.

Regards

ClassyDevs

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...