In our work for our clients, we are commonly asked to help reset the admin password to WordPress. There are numerous ways to do this, but if you do have SSH access, the easiest way is if you simply use the loss password function.
Using the Loss Password Function
If you know your username and the email account in your profile, you can use the “lost password” feature of WordPress.
- Go to your WordPress Login page (e.g. http://yoursite.com/wordpress/wp-login.php)
- Click on lost password
- Enter your user name and the email address on file for that account.
- The new password will be mailed to you.
- Once you get your new password, login and change it immediately as email is not a secure communication method.
- Access Mysql CLI
- Access the database (Check your wp-config.php if you are unsure)
mysql> use DATABASE_NAME;
- Update the password. In our example we are using “wp_users” as the table. Replace “NEW_PASSWORD” with your desired new password (If you are unsure of your table prefix, use “show tables;”)
mysql> UPDATE wp_users SET user_pass = MD5('NEW_PASSWORD') WHERE ID = 1;
- Exit Mysql and you should be able to login with the new password. Enjoy!