I forget my wordpress login, constantly. The following shows you how to change your password hash in the database so you can login again.
If you’re using PHPMyAdmin or another GUI you can skip to step 3.
Step 1.
Log in to mysql.
1
| root@localhost:~#mysql -u root -p |
(Optional) Step.
You can list all databases using the show command.
Step 2.
Switch to your wordpress database, via the use command. Substitue my_wordpress_database for your database name.
1
| use my_wordpress_database; |
(Optional) Step
You can list the tables in the wordpress database schema if you’re curios via the show command.
(Optional) Step.
If you need to check which users are in the table, execute the following SELECT statement.
1
| select * from wp_users; |
Step 3.
Update the hash user_pass MD5 hash using the following UPDATE statement. Substitue ‘your new password’ for the actual password and substitue ‘user’ for the user you wish to update. Note that you need to keep the quotations.
1
| update wp_users set user_pass = MD5('your new password') where user_login = 'user'; |
Hope that helps.