Change / Reset WordPress password using MySQL / PHPMyAdmin

3 minutes read

Imagine someone somehow manages to break into your WordPress dashboard, and changes it’s password and email. If you request a “Forget Password”, the reset password link will be mailed to the new email, not to your email. The result will be – you losing control over your WordPress-powered site. I think that’s enough to picturize that traumatic situation.

How would you cope up with such a problem? The first recommended step for a beginner-level user to restore WordPress is to contact the Hosting service. The restoration may take sometime, some hours, a day or even more depending on your Hosting provider’s service.

If you can dare to work in the cPanel or the control panel that your service has provided you with; here is a rather quick way to restore your password a few minutes.

Change / Reset WordPress password from MySQL / PHPMyAdmin

In the rest of this article, we’ll see how to reset WordPress password from PHPMyAdmin or MySQL.

Note: Implement only one of the below given methods, either Method#1 or Method#2 since both of these methods are similar and yield the same results. Following one of these two methods will help you to quickly regain control over your hacked WordPress admin account.

Method#1 – The Long way through PHPMyAdmin table editing

This method involves editing and updating the wp_users table values to reset our lost WordPress password. The method is little longer but is also easy enough to follow without knowing technical things.

  1. Head over to PHPMyAdmin using your cPanel (or the hosting panel that your hosting service supports).
  2. Click on your WordPress database.
    Select WordPress Database in PHPMyAdmin
  3. Navigate to and click the table wp_users.
    WordPress wp_users table
  4. Edit the row with your WordPress username.
    edit table row in PHPMyAdmin
  5. Now, in the user_pass field, change the function to MD5 and enter your new password in the Value section (refer below screenshot).
    change wordpress password from phpmyadmin
  6. Click “Go” or similar option at the bottom to update the table values.
    update table in phpmyadmin

Method#2 – The Short way through MySQL

This methods implements the direct SQL query execution to update the wp_users table value to reset our hacked WordPress password.

  1. Follow the first 3 steps of the above method.
  2. Go to SQL or MySQL section in your PHPMyAdmin.
    access mysql in phpmyadmin
  3. Now, enter the below given query:
    UPDATE `wp_users` SET `user_pass`= MD5('yourpassword') WHERE `user_login`='yourusername';

    Put your new password in place of yourpassword and replace yourusername with your WordPress username.

    execute sql query in phpmyadmin
  4. Click “Go” or similar option at the bottom to execute the query.

Congrats! You’ve successfully changed your WordPress password and regained the control over your WordPress admin, without even contacting your hosting provider. I found Method#2 very quick to implement, what about you?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

Related Posts:

To install and configure phpMyAdmin on XAMPP, follow these steps:Download phpMyAdmin from the official website ( by selecting the latest stable version.Extract the downloaded file and rename the folder to "phpmyadmin".Locate...
To access phpMyAdmin in XAMPP, follow these steps:Ensure that XAMPP is installed and running on your computer.Open your web browser.Type "localhost/phpmyadmin" in the address bar and press Enter.The phpMyAdmin login page will appear.Enter your username...
Setting up a password for the MySQL root user in XAMPP involves a few steps:Start by opening the XAMPP control panel and launching the "Apache" and "MySQL" modules.Go to your web browser, and type "localhost/phpmyadmin" in the address b...