There are occasions when we forget or don’t have password to some website admin logins. Same thing happened to me today when I was trying to login to concrete5 installation on my localhost.
As I was using it on localhost, i can’t ask it to mail me the password (without configuring the mailserver on my computer or by uploading the site to webserver).
I tried adding custom password with md5 hashed value to concrete5 database directly via phpmyadmin but it failed. So then how to fix it?
How to recover / change concrete 5 admin password via phpmyadmin on localserver
Well, the solution is simple, you have to enter new md5 password to users table (user we want to change the value for) in mysql database via phpmyadmin, but with a slight modification.
We first need to generate the md5 hash using the password_salt value for our concrete5 installation. Our attempt to insert new password to mysql database via phpmyadmin directly by using built in md5 function in input field failed because we didn’t use the salt value for our conrete5 installation. So how to do this? simple enough:
- create a new php file in your localhost directory
- copy this code to it:
<?php echo md5('password'.':'.'salt'); ?>
- change “password” to your password that you want to use and “salt” to the salt value for your concrete5 installation (found in: /config/site.php file)
Run this file and copy the value echoed by it. Now enter this value in phpmyadmin to your users password (don’t md5 it again).
Now try logging in and it will work inshaAllah.