1

I used to store password in database for sh1 or md5 like:

$password = md5($password);

It was very easy to reset password through phpMyAdmin - just edit user table, write password, select md5 or sh1 in function field and update the record.

Since I have changed password hash to argon2 it seems difficult or impossible to reset through phpMyAdmin.

Here is how I'm saving password in database. Can somebody guide me how this password could be reset through phpMyAdmin?

$options  = ['cost' => 12];
$password  = password_hash($password, PASSWORD_DEFAULT, $options);
  • What do you mean by reset? I would recommend to have a separate column in your table which would be either a boolean or date type and would specify that the password is reset. e.g. if field is NULL then the password is active if there is date then password has been reset. Do not touch the hash, let the user rehash it on next login. – Dharman Jun 09 '19 at 20:11
  • There is already a token in database table with name activation_token, Which remain empty unless user request password reset through Email. The activation token then sent by email and help to reset password. The purpose of this question is Let's say i am developer i forget my password and as i am working on localhost, its always easy to reset password going to phpMyAdmin. It was very easy when i used md5 but in argon2 PHPmyAdmin seems does not help. I wanted to know if there is any solution or not thanks. – Ateeq Rafeeq Jun 09 '19 at 20:25
  • That is the whole point of it. It is supposed to be difficult. If you want to copy-paste a hash directly into DB for which you know the password, generate something random e.g. https://3v4l.org/IpMuF – Dharman Jun 09 '19 at 20:27
  • A password manager would help you... ;) – Charlotte Dunois Jun 09 '19 at 22:48

0 Answers0