Ao, you’ve lost your username and password for your WP-Admin area, the reset password isn’t working and you need to get into your WordPress Admin area. Luckily there’s a way, all you need is access to your hosting account. Below, I’ll show you how to access WordPress admin from phpMyadmin in your hosting account:

Log Into Your cPanel and go to phpMyAdmin:

Most hosts use cPanel. If your hosting provider does not have cPanel, contact them and ask how to access phpMyAdmin from their control panel and move to step 2.

Most hosts will use the new Cpanel as seen above. From here look for the phpMyAdmin Button:

Many hosts use a slightly older version of cPanel, in which case, look out for the phpMyAdmin menu item under Databases:

Click on that and you’ll be directed to your phpMyAdmin database area. This is what you should be seeing:

There are now one of two options you can take to gain access:

  1. Change the Password of an Existing User
  2. Create an Entire New Admin User

Let’s look at the first option, which is easy:

Edit User Password

The fastest way to gain access is to see which usernames there are in the database, change the password and login.

  • Locate the _users table:
    You first need to find the table where your users are located. In most cases, the table will be called wp_users. Some sites do rename their table prefixes to something else, so look out for the table name ending in _users.

  • Change the Password!

    Click on that table, and you should see a list of all the users. You can see the username here in plain text. The password is encrypted with md5 though, so you can NOT just copy that password:

    You will only be able to change the password. But again, you also can’t just paste a new password in here. You have to paste an md5 hash in here. So go to: http://www.miraclesalad.com/webtools/md5.php.

    Here you can type the password you want and it will generate an md5 hash for you:

    Copy the hash and paste it into the user_pass field:

    This will effectively change the password for that user to the one you typed in the md5 hash-generator. (MyPassword123 in this case). Now just log in with that username and type the new password.

  • Add A Completely New Admin User

    You may be faced with the problem of not wanting to change an existing user’s password. That means you will need to create a new user to log in to the WordPress admin area. Fortunately, you can also create a WordPress admin user from phpMyAdmin.

  • Go to _users table
    We are again going to go to the _users table. In most cases, it would be wp_users:

  • Insert a New Record into wp_users:

    This time we are not editing anything, we are going to insert a record. Look for the Insert button in the top menu:

    Now fill in the fields as follows, leave any unmentioned as blank:

    • user_login: Enter a username you want.
    • user_pass: From the dropdown, choose MD5 and then type the password you want.
    • user_nicename: Type a nickname, just make it different from the username.
    • user_email: Type your email.
    • display_name: Make this the same as your user_nicename
    • Here’s what my example looks like:

      Then click Go.

    • Add 2 records to wp_usermeta:

      Before moving on to the next table, make a note of the ID of the user you just created. In our case it is 2:

      Go to the _usermeta table in your phpMyAdmin:

      Next, click the Insert button in the top menu:

      Fill in the form with the following fields (leave blank if not mentioned):

      • user_id
      • This is where you need to put the ID of the user you just created. In our case it is 2.

      • meta_key: Paste this in: wp_capabilities
      • meta_value: Paste this in: a:1:{s:13:”administrator”;b:1;}

      Here’s my example:

      Take careful note, the user_id should be the ID you got from the wp_users table when you added the user there.

      Click Go

      OK, we are not done yet, we now need to add Another record to this same table. So click that Insert button again:

      Fill in the form fields as follows:

      • user_id: Your ID that you got from wp_users.
      • meta_key: Paste this in: wp_user_level.
      • meta_value: Make this 10.

      Here’s my example:

      Click Go

    • You’re Done!

      That’s it! Now you can log in to the site directly using the username and password you just Created.

      Freebie: Get Help With This

      If you still need help with this, feel free to book a call with us. On the screen share call, one of our consultants will walk you through this. Book a call here.