There are times when you may forget your password. In these instances, you can have the PrestaShop admin password changed via email. If, for some reason, you do not receive the email for the new password, you will not be able to log into the admin area with it.
There is a fix, however.
You will need to change your password by modifying the database directly. This can be a bit awkward and intimidating, however following the steps below should allow you to change your PrestaShop admin password in your database without any trouble. Click here for more information on PrestaShop Hosting.
This article assumes you are using a hosting account that uses cPanel software for managing your hosting account.
Modifying your admin password via database in PrestaShop 1.5
- First you will need to log into the cpanel for your hosting account.
Once logged in, you will need to locate the File Manager, found in the Files category, and click on the icon.
Once in the File Manager, find and double click on the config folder. This will take you to a list of all files within that folder.
Look for the settings.inc.php file. Highlight it by clicking on it once. Then, using the icons across the top, find and click on the Code Edit feature. Click Edit from the pop up that will appear to continue.
<
Once inside the settings.inc.php file, locate the setting named _COOKIE_KEY and copy the string. You can see the area below that we highlighted. You may want to save it temporarily to a word processing document such as notepad, Notepad++, MS Word, etc. Close the file once you have the key.
Go back to your cPanel and find the Databases category. From there, click on the PhPMyAdmin tool.
- Once inside, select (click on) the correct database for your PrestaShop 1.5 application from the list of databases on the left hand sidebar.
You will then see a list of the database tables in the left sidebar. Scroll down and select the one named ps_employee.
Note that your PrestaShop database prefix might not begin with ps_
This opens the table data information. Find your admin user from the list of data rows and click on the Edit link on the right side of that particular row.
Find the password row, it is named passwd. There are two columns you will need to edit. The first is the Function column.
Use the dropdown and select the MD5 option.
The second column is the Value column. For this column, paste the _COOKIE_KEY value you saved earlier and attach your new password directly to the end of the key with no spaces. Be sure to use a real password and not anything easy like NEWPASS1234 that we used in the example.
- After you have entered the new password, scroll down to the bottom of the page and click the GO button to save the new information.
You should now be able to log into your admin area with your new password.
I’ve done this in the past and it worked on other sites I host. It’s not working right now. Using version 1.6.1.2 and tried this several times. Still coming up with:
There is one error.
What’s weird is I was working in the admin earlier today with no problem. Now it won’t let me in.
Unfortunately, if that didn’t work or caused further issues with the login, the only way to recover access would be to restore the database from a backup of when it was working. You also may want to check to make sure you are editing the correct user/password combination for the administrator user.
Helo evry body,
I followed the previous explanation but i did’nt found any data in settings.inc.php file it’s empty.
Please i need help.
Regards,
Riyadh
Hello,
This documentation is for PrestaShop 1.5, if your settings.inc.php is empty you are likely using a different version, They have changed the location of the configuration file frequently, if you can tell us which version of PrestaShop you are using we can tell you where you should find the config file.
Best Regards,
Kyle M
Perfect!!! it has saved my life!!! IT WORKS. THANKS !!!
Thank you so much!! so greatful
Works for me.
1. php -a
2. echo md5(‘cookie_key’ . ‘yourpassword’);
3. Copy output into the password field in the customer table
4. Done
What about if user is disabled…how to enable it?
THX
Hello Tadej,
You would need to login with an active user and enable the disabled one.
If you have any further questions or comments, please let us know.
Regards,
Arnel C.
SWEET!!!! Thanks =-)
Thanks a lot
Thanks ! It worked like a charm!
thanx u r the best 🙂
worked but and i had to do an additional step changing varchar from 32 to 64 because the cookie pass and new pass is too long
Thanks It Was Really Helpful
Hello Pepe,
I am unsure of what the second part of your message means, I apologize. If you can, please ask questions in English as we are an English site. I translated the question via Google translate, so it may be a bit off.
The cookie key should fit in the field. Are you getting an error message of some kind? Please provide the error text so we can assist you further.
Kindest Regards,
Scott M
great and very useful!!!
Thanks friend
en el segundo campo despues de md5 no cabe el texto de la COkkie key (estamos apañaos!)
Google translated:
in the second field after md5 does not fit the text Cokkie key (we are APAA ± years!)
Thanks , It works
LOVE IT. DON’T CHANGE IT. IT WORKED! AND EASY TO FOLLOW (EXCEPT ONE THING. .. NOT EVERYONE NAMES THEIR DATABASE “PS”).
Hello Bonita, and thanks for your comment.
Thank you for pointing this out, I’ve gone ahead and added a notice above at step 9 to clarify that your PrestaShop database might not be using the default ps_ prefix.
Thanks again!
– Jacob
I think ofcourse you can login now, because i requested for backup restore. None of the support can fix that. Until now, I dont know what the root cause.
Hello Andy,
I tested with the techs before the database restore where the password is located. But I am glad it is working for you now. If the errors return feel free to comment back here and I will take a deeper look at your files and database content.
Kindest Regards,
Scott M
Still not working Jeff. Even, the support guy tried the same thing on my behalf. They still can’t get it worked 🙁
Hello Andy,
I tested the above steps with different versions of PrestaShop without error. I also got in touch with the tech who worked with you this morning and the username and password you provided him allow me to sign into the back office without error. Did you get the issue fixed or was it another user that is having issues with logging in?
Kindest Regards,
Scott M
Hi all,
After i did reset via the database as per above article and using the LostPassword feature, it does not solve the problem. The error still persists, strangely my employee database looks good.
Pls reply if you encountered same thing or if you have solution. Appreciate. Thanks
I noticed that you posted a question about this as well. The answer to your question may be found at the following:
cannot login at back-office prestashop
tanx tanx tanx …………….