Monday, December 22, 2014

Tutorial: How to change username and password in wordpress database


For some reason you would want to change the username and password for your wordpress database installed in your server. Perhaps, the reason you do this is because you can’t able to login into your wordpress admin dashboard.

There are few possible reasons why you can’t access your wordpress dashboard.
1.       Your wordpress website has been hacked.
2.       You forgot your username and password.
3.       Wordpress password retrieval doesn’t work.

So, in order to get into your dashboard is to access your wordpress database.  Now, you may ask how to access your wordpress database? And what table you should look for in changing your username and password?

In this tutorial, I’ll show you a simple process to do this. First thing first, you need to have access to your cpanel. This is pretty basic and easy. See step by step guide below:

  1. Login to your cpanel and look for database section.
  1. Now, tick on phpmyadmin icon and then it will open a new tab in your browser. Take note that some hosting will require you to logon to phpmyadmin using the same username and password as your cpanel.

  1. Select the database of your wordpress installed. Mine here named staging.

  1. Then click on wordpress users tables (wp_users).

  1. Mine here has only one user which is admin. If you happen to have many users, just select the user you would want to change. Then click edit link to change your username and password. See image below.


  1. Now in this step, I’ll show you how to change the username and password.  In the screenshot example below, the user_login  value is “admin” and the user_pass value is “$P$BZ2p8jq312wEb6eJ7Ea4da8nq60Vuk/
Note:  The user_pass value should be using the MD5 function. So whatever password value you’ve changed for the user_pass column it will not stored in the database.  See below screenshots.

For example we are trying to change username and password with the following values below:
User_login: admin >> change to admin_secure
User_pass:  $P$BZ2p8jq312wEb6eJ7Ea4da8nq60Vuk >> change to password123
Old username and password:
Change to new username and password and set to MD5 function
Then click the “GO” button once done. If you notice on the screenshot below, the username and password has been changed.

That’s all! Now, try logging in using your new username and password. I hope this simple tutorial may find you helpful.


No comments:

Post a Comment