Skip to main content




  1. 1. How to reset your WordPress password using phpMyAdmin
  2. 2. Today reading: How to reset WordPress password with MySQL

Our WordPress password recovery series is sorted by popularity of the mentioned tutorial. For starters, you have the most popular recovery option, in other words, use phpMyAdmin.

There are certain web hosting providers that do not provide cPanel and / or phpMyAdmin. What do you do then? Read this article!

wpmysql-cover-6477508

Rest assured, since WordPress used a database (commonly MySQL), every hosting provider must have a database management system better known as DBMS. In this tutorial, we will use the MySQL command prompt (abbreviated as CMD) which is a free DBMS licensed under the GNU General Public License v2.

Prerequisites

Recovering your password using MySQL CMD involves fewer steps and can be considered a universal password recovery system; in the sense that it can be used in almost any plausible scenario.

Regardless, you must have a working knowledge of databases and how WordPress interacts with one. Apart from that, at the same time you need to know the following technical aspects:

  • Name of the database used by the WordPress installation
  • MySQL server address (IP or hostname)
  • MySQL login credentials of user 'root'
  • The user ID of the user whose associated password you want to change. Usually it is 1 since, during the WordPress installation, we create the administrator user. Note that the username of the admin user can be 'Jack' or 'Mike' or 'admin', but the user ID will always be 1, since this is the first user you are creating.

Log in to the MySQL command prompt

Windows

If you are running an offline installation of WordPress on Windows using WAMP or XAMPP, to start MySQL CMD, click the WAMP icon> MySQL> MySQL console. This connects you directly. No need to access any more commands. Go to the next step.

mysql-console-wamp-9399422

Linux

Most of the providers of shared hosting, VPS, dedicated servers use a variant of Linux that includes CentOS, Debian, Fedora or Ubuntu, to name a few.

If you are running an offline installation of WordPress on Linux using LAMP, just launch the terminal emulator and type the command:

mysql -u root -p

If you are trying to reset your password on a remote server, connect via SSH using any SSH client, for example, the world's favorite client, Putty. Once you have logged into the remote server, to log into MySQL, use the following command:

mysql -u root -p

logging-into-mysql-on-a-remote-server-vps-2210744

WordPress password reset:

Now that you have access to the MySQL CMD indicated by the "mysql>" prompt, it's time to do the magic. Well, no magic, just good MySQL commands. 😀

shell-4481534

ASSUMPTIONS:

  • WordPress database name: wp_genesis
  • User ID: 1
  • New password: WPEXPLORER

WORKING THE MAGIC:

Enter the following ditto commands:

use wp_genesis; SELECT ID, user_login, user_pass FROM wp_users; UPDATE wp_users SET user_pass = MD5 ('WPEXPLORER') WHERE ID = 1 LIMIT 1;

In case the last command does not go according to the screenshot, remove the single quotes and write them manually in the CMD. That should do the trick.

reset-wp-password-from-mysql-cmd-wamp-9960943

This will reset the administrator user password to WPEXPLORER. Of course, when setting a new password, you will have to use a stronger one. Once this is done, you can exit MySQL CMD using the command:

exit

Video-tutorial

Here is a video tutorial that describes the whole process. I would recommend reading the article first, but if you are looking for a quick fix, this is your tail:

conclusion

As a conclusion to our WordPress password recovery series, I would like to remind you that part (a) is simpler because 90% from hosting companies come with phpMyAdmin. But if you have some spare time, I recommend trying this part (using MySQL) as it will give you some experience in handling MySQL commands and databases. And who knows, it might be of some use in the future!

Prevention is better than cure

lastpass-4757912

I started this series by saying how password storage / backup services like Last pass to flourish. Don't get me wrong, I didn't mean to sound demeaning. In fact, I love and use LastPass every day. I have it installed on my phone and in all the browsers of all my computers. Life (for me) would stop without him. Honestly, I can't survive without him.

LastPass, as it is one of the most comprehensive and easy-to-use password management software out there. I highly recommend using it. And every time you log into a new website, be sure to save the password! 😉