phpMyAdmin can be used to reset the username / password of a user. Especially if the mail server is not working and you have access to your phpMyAdmin.
Changing the username:
– Log in to phpMyAdmin
– Click on the database name in the left panel
– Now go to ‘users’ table
– Select ‘Edit’ or ‘Inline edit’ on the row where you want to make the changes
– Change the username and save
Changing the password:
– Drupal 7 uses a SHA512 encryption on the passwords. As a results md5(‘password’) which works on Drupal 6 does not work here
– We first need to generate a hash for the plaintext password we want to use
– To generate password hash:
On the machine where Drupal 7 is installed, redirect to the Drupal 7 root folder. The following command generates a hash.
Example: ./scripts/password-hash.sh “hello”
Here, ‘hello’ is the new password I want to use. Hash is generated as follows:
password: hello hash: $S$Dep88IN0xZzRr50qEStaDvnjrdbmWoL0euRRmW7pBAffeSeKbTe9
– Similar to when changing the username, edit the password field using the hash generated above
This method works just fine for any user, let the user be the admin or not.