How to change / reset OSCommerce lost / forgotten admin password?
The password in OSCommerce is kept in table "admin", so to reset password connect to MySQL with mysql cli client.
First thing to do is to generate the new hash string, you can do that with a simple php script using the md5(); function
root@pcfreak:/var/www/files# cat 1.php
<?
$pass=md5('password');
echo $pass;
?>
root@pcfreak:/var/www/files# php 1.php
5f4dcc3b5aa765d61d8327deb882cf99
root@pcfreak:/var/www/files#
Our just generated string (for text password password) is hash: 5f4dcc3b5aa765d61d8327deb882cf99
Next to update the new hash string into SQL, we connect to MySQL:
$ mysql -u root -p
And issue following command to modify the encrypted hash string:
UPDATE `DB`.`admin` SET `admin_password` = '5f4dcc3b5aa765d61d8327deb882cf99' WHERE `admin`.`admin_id` = 6;
More helpful Articles
Tags: cat, echo, hash, How to, pcfreak, php script, root, string, var, www