How to reset Drupal admin user password easily?
In this post, we shall see how to reset Drupal admin user password easily from phpMyAdmin. If it is on a production site, we can do "forgot password" to let Drupal send us a password reset link. But on local development server, we might not have a provision to do it. So we may need to do it some other ways. We can reset passwords for user from phpMyAdmin by running some scripts. But as you might already know that passwords in Drupal are hashed. So we need to know the hash code of a password before running such sql command. I have included a SQL code for password reset in Drupal 7 at the end of this post.
This example is on local Drupal 7 running on XAMPP (Windows). In this example, we generate a hash code of a password we desire and replace the existing hash code in PHPMYADMIN with the new one to change the password. Admin can then login in with the new password and may change the password as usually done in Drupal by editing the user.