How to reset WordPress user password from database back-end (phpMyAdmin)?

| | ,

We can reset WordPress user password in more than one ways. Normally, the easiest way to reset WordPress user password is through the “Lost your password?” link on the main login page. “Lost Your Password” link takes us to password reset page where we can enter our username or email address to reset the password. After that WordPress sends a password reset link to the email address associated with that user account. This will work if you have access to that email address or if WordPress sends out the email. However, there are times when we may have to reset WordPress password from the back-end, such as when the email isn’t working correctly or if we don’t have access to the email address.

In such situations, we will need to reset the WordPress password directly in the database. The easiest way to do that is by using phpMyAdmin. phpMyAdmin is a free and open source administration tool for MySQL and MariaDB, which is most commonly used for MySQL database administration on web hosts.

In this post, we’ll see how to reset WordPress user password from database backend (phpMyAdmin).

How to reset WordPress user password from database backend using phpMyAdmin

To reset WordPress user password using phpMyAdmin, we need access to phpMyAdmin obviously. For that, we need to login to the administration panel provided by the web host such as cPanel or Plesk etc.

  • After we are logged in to cPanel, find phpMyAdmin icon under the database section. Log in to phpMyAdmin and select the correct database for the WordPress website.  If you are provided with Plesk web administration, you need to go to databases tab, and then click on phpMyAdmin.
  • This will open phpMyAdmin app. Select the WordPress database from the left sidebar.
  • List of tables in your WordPress database will be visible on the right main area.
  • Now look for a table by the name ‘table-prefix_users’ in this list and click on the ‘Browse’ link next to it.

Note: Default table name is `wp_users`. But the table-prefix may be different in your case.

  • List of WordPress users present in the users table will be visible as separate rows in the users table.

reset-wordpress-password-phpmyadmin

  • Click on the edit link next to the username for which you want to change the password. PhpMyAdmin will display a form with all the user information fields.
  • Look for the field `user_pass` and replace the value with your new password as it is.
  • Under the function column, select MD5 from the drop down menu.
  • Click on the Go button at the bottom of the page.

reset-wordpress-password-phpmyadmin

The new password will be encrypted using the MD5 hash and then it will be stored in the database.

That is all! You have successfully changed your WordPress password using phpMyAdmin.

Test it by attempting to log in from the login page as usual.

Another way to reset WordPress user password using phpMyAdmin is by executing an SQL script.

  • Open phpMyAdmin.
  • Select the WordPress database from the left sidebar.
  • List of tables in your WordPress database will be visible on the right main area.
  • Click ‘Browse’ link next to the users table ( wp_users or ‘your-table-prefix_users)
  • List of WordPress users present in the users table will be visible as separate rows in the users table.
  • Note the User ID or the User_login for which you want to reset password.

For example: each row in the user table will have columns like:

ID, user_login, user_pass, user_nicename, user_email

  • Click on SQL tab.
  • Replace the existing query with a query like the ones given below:
    Note: update ‘wp_users’ with correct table prefix in your case.

UPDATE `wp_users`
SET `user_pass` = MD5( ‘write-password-here-as-it-is‘ )
WHERE `wp_users`.`ID` = “2”;

This script will find the user with ID  2 in the wp_users table and update the password for the user to the new password entered in the script.

OR you may also use the script below:

UPDATE `wp_users`
SET `user_pass` = MD5( ‘write-password-here-as-it-is‘ )
WHERE `wp_users`.`user_login` = “tttt_addd”;

This script will find the user with user_login / login ID  = tttt_addd in the wp_users table and update the password for the user to the new password entered in the script.

  • After the SQL script is verified correct, click GO button to apply the script

The SQL script will be executed and the password will be reset. Test it by attempting to log in from the login page as usual.

 

For other ways to reset WordPress user password, refer WordPress support link here.

Previous

Induction Stove Not Working, MCB Trips and Power Supply Goes Off

How to attach an email as an attachment in Thunderbird email client?

Next

Leave a Reply