Linux Mint - Free and powerful

Saturday, 24 May 2014

How to Reset WordPress Password using MySQL - WPExplorer

How to Reset WordPress Password using MySQL - WPExplorer:

'via Blog this'

How to Reset WordPress Password Using MySQL Command Prompt

Post Series: WordPress Password Recovery
  1. 1.How To Reset Your WordPress Password Using phpMyAdmin
  2. 2.How to Reset WordPress Password Using MySQL Command Prompt
Our WordPress Password Recovery series is sorted according to the popularity of the tutorial mentioned. For starters, you have have the most popular recovery option – i.e. using phpMyAdmin.
There are certain web hosting providers who do not provide cPanel and/or phpMyAdmin. What do you do then? Read this article!
Rest assured, since WordPress used one database – (commonly MySQL), every hosting provider must have a Database Management System better known as DBMS. In this tutorial, we’ll be using the MySQL command prompt (abbreviated as CMD) which is a free DBMS as licensed under GNU General Public License v2.


Recovering your password using the MySQL CMD involves lesser number of steps and can be thought of as an universal password recovery system; in the sense that it can be used in almost any plausible scenario.
However,  you need to have a working understanding of databases and how WordPress interacts with one. Apart from that, you also need to know the following technical aspects:
  • Name of the database being used by the WordPress installation
  • MySQL server address (IP or hostname)
  • MySQL login credentials of the ‘root’ user
  • The user ID of the user whose associated password you want to change. This is typically 1 since, during WordPress installation, we create the admin 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’re creating.

Logging in to the MySQL Command Prompt


If you’re running an offline installation of WordPress in Windows using WAMP or XAMPP, then to launch the MySQL CMD, click on the WAMP icon > MySQL > MySQL console. This directly logs you in. There’s no need to enter any more commands. Head over to the next step.
MySQL Console WAMP


Most shared hosting providers, VPS, dedicated servers use a variant of Linux which include CentOS, Debian, Fedora or Ubuntu to name a few.
If you are running an offline installation of WordPress in Linux using LAMP, then simply launch terminal emulator and type the command:
1mysql -u root -p
If you’re trying to reset the password in a remote server, connect to it via SSH using any SSH client – for example, the world’s favorite client – Putty. Once you have logged in to the remote server, to login to MySQL, use the following command:
1mysql -u root -p <password>
Logging into MySQL on a remote server VPS

Resetting the WordPress Password:

Now that you have access to the MySQL CMD indicated by the “mysql >” prompt, its time to work the magic. Well, not magic – just good ol’ MySQL commands. :D
MySQL Shell


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


Enter the following commands ditto:
1use wp_genesis;
2SELECT ID, user_login, user_pass FROM wp_users;
3UPDATE wp_users SET user_pass = MD5(‘WPEXPLORER’) WHERE ID=1 LIMIT 1;
In case the last command does not go according to the screenshot, delete the the single quotes and manually type them in the CMD. That should do the trick.
Reset WP Password from MySQL CMD WAMP
This will reset the password of the admin user to WPEXPLORER. Of course, while setting a new password, you’ll have to use a stronger one. Once done, you can exit the MySQL CMD by using the command:

Video Tutorial

Here’s a video tutorial describing the entire process. I would recommend reading the article first, but if you’re looking for a quick fix, this is your queue:


In conclusion to our WordPress Password Recovery series I’d like to remind you that part (a) is simpler because 90% of the hosting companies come with phpMyAdmin. But if you have some free time, I’d recommend trying out this part (using MySQL) as it’ll give you some experience in handling MySQL commands and databases. And who knows – maybe it’ll be of some use in the future!


I started this series off by saying how password saving/backup services like LastPass thrive. Don’t get me wrong – it wasn’t my intention to come across as demeaning. I actually love and use LastPass everyday. I have it installed in my phone and in every browser in all my computers. Life (for me) would come to a stand-still without it.  Honestly, I can’t survive without it.
LastPass, as it is one of the most complete and user-friendly password management software out there. I would highly recommend using it. And every time you login to a new website, make sure you actually save the password! ;)
Logos belong to their respective owners. We’re using it for educational purposes only.


Post a Comment

Thank you for taking the time to comment. Your opinion is important and of value and we appreciate the positive feedback! If you are "Negative Nancy" then please do us, and humanity, a favor, and piss off.

Total Pageviews

Google+ Followers


Blog Archive

Popular Posts

Recent Comments

Rays Twitter feed


Web sites come and go and information is lost and therefore some pages are archived. @rayd123. Powered by Blogger.