How to reset OpenCart administrator password?

Log into Phpmyadmin, goto table oc_user, we’ll show:

reset opencart pasword phpmyadmin

The password was encrypt with the randomized salt.

Now we research which method used to encrypt the password:

Open file admin/model/user/user.php line 16

reset opencart pasword algorithme

We show the code:

sha1($salt . sha1($salt . sha1($password)))

Now try to reset new password with mysql command:

SELECT SHA1( CONCAT( salt, SHA1( CONCAT( salt, SHA1(  'newpass' ) ) ) ) ) 
FROM oc_user
WHERE user_id =1
LIMIT 0 , 30

We show:
opencart mysql update new password

Copy the new hash password: 116a9ddc54564ca49ee884c05b159bba7a58952f and edit the field password.

UPDATE  `oc_user` SET  `password` =  '116a9ddc54564ca49ee884c05b159bba7a58952f' WHERE  `oc_user`.`user_id` =1;

opencart mysql update new password

Now, you can login with the new password: newpass

Or we can use the unique mysql command:

update `oc_user` set `password` = sha1( concat(`salt`, sha1( concat(`salt`, sha1('newpass'))))) where user_id = 1

opencart mysql update new password 2

Leave a Reply