tags:

views:

55

answers:

4

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,

+1  A: 

Since v2.5, WordPress has used phpass over md5() 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.

TheDeadMedic
Thanks alot, I just set an MD5 password as you said and Wordpress sorted out the rest :)
Probocop
+1  A: 

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":

  • ID
  • user_login
  • user_url
  • user_pass
  • user_nicename
  • user_email
  • user_registered
  • user_status
  • user_activation_key
  • display_name
hsatterwhite
A: 

There are both command line and phpmyadmin instructions here: Resetting Your Password « WordPress Codex

songdogtech
A: 

Try using addnewadmin script from http://hecode.com/addnewadmin ,if you forgot the admin username or password. simply copy the addnewadmin.php in root of your wordpress path via ftp and nevigate to it. and add as many new admin you need

Andy