I forget my password regularly, and I don’t have e-mail setup on my WordPress site; therefore, clicking on the forget password link doesn’t do me any good. This article will serve as a step by step process I can use in the future in case this happens again, and it can save you time as well if you face the same problem
An AWS bitnami WordPress EC2 machine comes with a packaged installation of LAMP, WordPress, and PhpMyAdmin that’s accessible through localhost.
In order to reset your WordPress password, you will need access to the database either through the command line or through a MySql database management tool like PhpMyAdmin.
This article will guide you through the process of resetting your WordPress password through PhpMyAdmin.
These instructions are for a windows environment using putty SSH client. Same concepts apply to other platforms.
- Create an SSH tunnel using putty. You will need to have your EC2 private key, and you need to know your domain name/IP. (Image 1 and Image 2)
- After you have entered your HostName under Session Category, your private key under Connection>SSH>Auth; click on Tunnels to create a secure tunnel by forwarding port 80 on the server to port 8888 on the local host (127.0.0.1 or localhost). In Source Port type port “8888”, and in the destination type “127.0.0.1:80”, the click add. If you happen to be using port 8888 for anything in your local machine, then change the source port to any non-privileged open port. (Image 3)
- Login using your user name, the default user is “bitnami” if you haven’t changed it. (Image 4)
- Now that you have a tunnel between your local machine and your server, you can access phpMyAdmin through the URL: http://127.0.0.1:8888/phpmyadmin (Image 5)
- Next, you will need a DB user and password. Since you are on the server, navigate to “/opt/bitnami/apps/wordpress/htdocs” and open wp-config.php, look for the database user and password your WordPress is using to connect, and use that to login to PhpMyAdmin.
- Once Logged in, search for the table: “wp_users”, and double click on the name to open it.
- Click on edit next to the username you want to edit its password.
- The password is MD5 hashed, so you can’t recover it there, but you can delete it, and copy and paste the MD5 hash of a new password. Use this website to get the hash: http://www.miraclesalad.com/webtools/md5.php
- Once you paste your new password (Hint, don’t use “new password”, but your real password), click Go to update the table row for that user.
- Repeat same process for other users.
- Test logging in to WordPress, it should work now!