In a world where passwords need to be more complicated, issues sometimes can happen, getting lost in a sea of passwords or a simple technical malfunction can set you back, if you are the only one that has access to the website then, who do you turn to ?
This is assuming that you own your website, I am not teaching you how to hack another WordPress website here, if you are looking for that, this is the wrong post for you. We are dedicated to the safety of our clients and our own websites.
1. There are a few obvious ways to restart your password, the first one of course is the WordPress forget password which is the first and easiest option which should come to mind, but if you are like me and haven’t set up a SMTP still, than you cannot send emails from the website. What next ?
2. If you use Cpanel you are in luck! You can change the password in the phpMyAdmin by editing your WordPress database. I will list the steps you need to do now:
- Log in to your phpMyAdmin
- On the left hand side, find the database you are using for your website
- Click to expand and search for wp_users table.
- After clicking you should see your username in there, just click the Pen (Edit) icon next to the username
- There you will see the column user_pass, It is important that you set MD5 in function next to the password, or else it wont work.
- Enter the new password you wish to use, next to the MD5 field.
- Click GO on the bottom right of the screen
That’s it! Now you can log in with your new password!
3. Some people don’t have visual phpMyAdmin and use the terminal, if this scares you, don’t worry. Follow these easy steps and you will find out how to do the same as phpMyAdmin with a few simple commands.
- Log into your terminal
- Depending on what you use for Database management, log into your shell, the command for MySQL is
mysql -u root -p
This will log you into mysql as -u – user -root with -p password. Which you will need to provide, if you don’t have a password set simply remove the -p.
- You should be logged in by now, next what you will do is list all databases so we find the correct one! You do this by simply typing the command:
- You will get a square of database names, lets say our database name is wptesting that is where our username and password for the website are stored,
we will now choose this database to work with:
- You should get a small message saying, Database changed, after this we will use the command
- Here is where we need to find the table wp_users, you should be able to see it usually at the bottom, now we wish to list the fields of that table and we use:
- If you wish to check how many, which users exist on the database you can do it with the following command:
select user_login from wp_users;
- We can see that the field user_pass exists and this is where we need to edit our password. This is where the magic happens:
update wp_users set user_pass=MD5(‘newpassword’) where user_login=’user’;
You should get a message saying: Query OK, 1 row affected
After this you are all set! You can log in with your new password!
We understand that not everyone feels comfortable using the terminal or phpMyAdmin to change their own password. If you feel that you need more help do not hesitate to contact us as we are here to help you!
Thank you for reading!