To reset a WordPress password using the MySQL command line interface (CLI), you will need to:
mysql -u username -p
Replace username
with the MySQL username you want to use to connect to the database. You will be prompted for the password for this user.
USE databasename;
Replace databasename
with the name of the WordPress database.
SELECT * FROM wp_users WHERE user_login='username';
Replace username
with the username of the user whose password you want to reset. This will display the user's record in the wp_users
table.
UPDATE wp_users SET user_pass=MD5('newpassword') WHERE user_login='username';
Replace newpassword
with the new password that you want to set for the user, and username
with the username of the user whose password you are resetting.
quit;
The password for the specified user will now be reset to the new password. You can log in to WordPress using the new password.
Keep in mind that this process assumes that your WordPress installation is using the default database prefix (wp_
) and that you know the name of the WordPress database. If your installation is using a different database prefix or if you are not sure of the name of the WordPress database, you will need to modify the commands accordingly.