SQL to change Drupal 6 password directly in database

Need to change a Drupal 6 user password in your database using the command line or a tool like PhpMyAdmin or MySQL Workbench?  Use SQL like this:

update `users` set `pass` = MD5('NewPassword') where `uid` = 1;

or

update `users` set `pass` = MD5('NewPassword') 
where `mail` = 'useremailaddress';

In the first case I’m updating the password for the Drupal user whose uid is 1, and I’m making their new password ‘NewPassword’.

In the second case I’m updating the password for the Drupal user whose email address is ‘useremailaddress’, and I’m making their new password ‘NewPassword’.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: