Threat Picture
Latest Cybersecurity News
How to Reset a WordPress User’s Password From Within MySQL

How to Reset a WordPress User’s Password From Within MySQL

Locked out of the admin screen? The wp_users table and one SQL command put you back in.
By Charles Joseph · Updated
Share
Share
Copy URL

In WordPress, user passwords are stored in a database table named “wp_users.” This table contains 10 fields, each holding different types of user information. These fields are:

  • ID
  • user_login
  • user_pass
  • user_nicename
  • user_email
  • user_url
  • user_registered
  • user_activation_key
  • user_status
  • display_name

To reset a user’s password, you’ll need to use a specific command in MySQL that updates the password for a chosen user.

When using this command, replace <username> with the actual username of the account you want to reset.

Also, if your WordPress installation uses a table prefix different from the default “wp_” make sure to replace “wp_” with your custom prefix.

Here’s the command:

mysql> UPDATE ‘wp_users’ SET ‘user_pass’ = MD5( ‘new_password’ ) WHERE ‘wp_users’.’user_login’ = “<username>”;

This command changes the password for the specified user to ‘new_password.’

Remember to replace ‘new_password’ with the actual password you want to set.

Related Posts:

QUOTE:

"Amateurs hack systems, professionals hack people."