How to reset your WordPress password via SQL

You may have the need to reset your wordpress password and here I'll show you how to do that, assuming you have access to your sites MySQL database.

WordPress stores the password for your user in the wp_users table. The password itself is assumed to be hashed with MD5. You can set a new password with the following query:

UPDATE `wp_users` SET `user_pass` = MD5('mynewpassword')
WHERE `user_login` = 'user_x';

Just replace user_login value ("user_x" in the query above) with your own username and replace the password ("mynewpassword in the query above) with the password you want.

To list users that exist in the database, you can use this simple query:

SELECT * FROM wp_users

That's all there is to it.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.