From time to time I need to reset the password of some WordPress user. Be it because I (or the client) forgot, it's a clone site, an old backup, etc.
And the easiest way is to run the commands:
use base_name; SELECT user_login, user_pass FROM wp_users; UPDATE wp_users SET user_pass = MD5 ('newpassword') WHERE user_login = 'username';
If you do not remember the name of the database, try using the command “show databases;” to look at the databases in the database.
It may also happen that the wp_users table has another name, because sometimes during the installation the prefixes can be changed. But it will probably be something_users.
Be careful to use the correct quotes, sometimes when copying and pasting the commands they bug.
The MD5 function is required to make the password an md5 hash. You can generate this hash externally, or copy from another user, for example, and paste directly there without using the function.
Also be sure to change the values new password and username.
Remembering that it's not possible find out the old password, just replace it.
Leave a Reply