Reset Your WordPress Password Using phpMyAdmin

Reset Your WordPress Password Using phpMyAdmin



WordPress is perhaps one of the most common web applications these days, used primarily as a blog (such as this one), but increasingly as a full content management system (CMS). Its greatest feature is the ease at which you can login to the back-end and update content (such as posting new blogs) or modify the look and feel using themes.

However, every now and then you might find that you’ve lost the Admin password and have no way of logging in to the site. This commonly happens when people buy a new computer and realise they have no idea what their password is and were previously relying on their browser’s ‘saved passwords’ feature.

If this describes your predicament, you can follow these (relatively) simple steps to reset your admin password. Note that the fundamentals of this tutorial work not only for WordPress, but also for other PHP/MySQL based web applications such as Drupal, Joomla and e-commerce solution Magento. I have described the process for a cPanel user, although if you don’t have cPanel you should still be able to follow along (as long as you know your way around your server!).

Without further ado, if you’ve lost that password, here’s how to get it back:

1. Login to your cPanel account, this will generally be located at http://<yourdomain.com>/cpanel if you don’t have your login credentials for cPanel as well, you may need to contact your host to have them reset.

2. Once logged in, you will need to find the icon labelled ‘phpMyAdmin’, it should look something like the image below.

 

phpMyAdmin in cPanel

3. This will bring you to yet another login prompt for phpMyAdmin. These are the credentials for the database user, you will need to either know them, or in the case of a WordPress install, they will be found saved in the main wp-config.php file (accessible via FTP or through cPanel’s file manager).

 

4. Now we’ve exhausted all our usernames and passwords, we are ready to reset the WordPress admin password. You will be greeted in phpMyAdmin with a list of database tables (as in the picture below); in WordPress, it is the users or wp_users table which needs to be edited. To do this, click Browse on the wp_users row

Wordpress Database Tables

 

5. Now you will see a list of users whose passwords can be edited. In most cases you will be looking for admin in the user_login column (as below). Click Edit on the admin user’s row.

Edit Admin User

6. On the next screen, you will see a field where you can enter a new password. However you will also notice that the password is encrypted with what’s called an MD5 hash. In order to enter a new password, you will need to encrypt it. Handily, phpMyAdmin has a great feature that allows you to do this directly. Simply enter in your new password into the ‘user_pass’ field and then select ‘MD5’ from the drop down box to its left (as below).

MD5 Password

 

7. Now click “Go” at the bottom of the form and your password will be reset!

Hopefully this post has successfully walked you through resetting your WordPress password. It’s worth noting that the previous steps can be followed for most PHP / MySQL based content management systems such as Joomla or Magento; in these cases you will need to locate the alternatively named ‘users’ tables and ‘user_pass’ field. Once you’ve navigated into phpMyAdmin, finding the correct fields to change should be fairly intuitive, but if you can’t find them, it’s always just a Google search away!