How would I go about changing a Wordpress user's password directly in the database? I notice it's not just an md5'd password. There is a $P$B
at the start
Thanks,
How would I go about changing a Wordpress user's password directly in the database? I notice it's not just an md5'd password. There is a $P$B
at the start
Thanks,
I did it like this:
Note: you may need to change the ID of your user.
Then, you can check it:
Right now, the password won't have the WordPress format, but WordPress will understand it as MD5, and it all works great!
There are both command line and phpmyadmin instructions here: Resetting Your Password « WordPress Codex
Instead of running SQL to change the password, use the wp_update_user function. It will hash, dash, slash, bash, crash, and encrypt the new password for you! :)
Example:
wp_update_user( array ('user_login' => 'johndoe', 'user_pass' => 'my_new_password') ) ;
The following is a list of available "arguments":
If you have access to codebase then :
In the function look for the following line :
After this line, add the following lines :
Note :
This requires username to be correct.
Don't forget to replace YOUR_USERNAME with your username.
Undo the changes once you logged in.
Since v2.5, WordPress has used
phpass
overmd5()
for storing hashed passwords in the DB.However, I think you can still reset your password in MySQL with a standard MD5 hash. Once you've logged in again, WordPress will 'upgrade' the stored hash with the new algorithm.