logo
  • Home
  • About
    • Portfolio
    • Contact
  • Blog
    • SEO
    • WordPress Help
    • DIY
    • Raspberry Pi
    • Reviews
    • Troubleshooting
    • Tech Gadgets
    • Code
  • News
  • Home
  • About
    • Portfolio
    • Contact
  • Blog
    • SEO
    • WordPress Help
    • DIY
    • Raspberry Pi
    • Reviews
    • Troubleshooting
    • Tech Gadgets
    • Code
  • News
Home 2020
2020 How To Projects Tech Support Troubleshooting websites WordPress

Can’t Login to WordPress Admin? Add WordPress user to phpmyadmin

By William Sullivan March 2, 2020 7
How to add user to Wordpress when Locked out, Regain access

How to add a user in phpMyAdmin when you cant login to wordpress admin

Last week, one of my new clients reached out to me, afraid her previous Web Designer hacked her website.   She told me they were having disagreements about the work done, the expense he charged for hosting, and long story short – she fired him.  She paid the Designer for the website, but stopped paying for the monthly services.  She can’t login to her WordPress Admin.

Her site was still up, but now she can’t login to her WordPress admin.  She needed help to regain access to WordPress.

Can't Login to WordPress Admin

When I looked at her site, I noticed that she can’t login to the WordPress admin, because someone deleted all the WordPress admin users.  I jumped in the database, and decided to add a new WordPress Admin user via phpMyAdmin.  

All her work was still in the database, luckily.  I helped her set up a Firewall and change all passwords related to her WordPress/hosting, and she was up and running that same day.  

In this article, I will show you how to add a WordPress admin user via phpMyAdmin, when you can’t login to WordPress Admin

How can I add a WordPress user if I can't login to the WordPress Admin?

Note*  Back your site up!   All of this can be avoided, if you take backups of your site, BEFORE it happens.  So, before making ANY MySQL edits, make sure you have a backup.   This guide to add a WordPress user via phpMyAdmin requires basic knowledge of databases.  Again, don’t forget to back your WordPress site up!  Don’t know how?  Let us do it for you.  We have WordPress Support and cheap backups.

Need backups, but don’t have access to your site?  No problem!  We provide daily, automatic backups for only $3/month.  Don’t know how to back up a WordPress site?  We do it all for you.  See our plans starting at $3 at https://login.digitallythrive.com/products/website-backup.  Create an account, and after signing up – just call the number, let us walk you through the set up – Free 24/7 phone support.

1. Find the database user/password and login

learn where to find the database username and password for WordPress, find the wp-config.php file and you will see it under the database connection area
Find the wp-config.php file.

When you can’t login to the WordPress Admin, you will need access to the database.  First, collect your database credentials – these are not your WordPress username/pw, this will be different.  

Luckily, this is simple if you have a basic understanding of WordPress file structure.  Login to the file manager, and open up the folder of your WordPress site.  This should be inside your hosting account.  If you can’t find it, call your hosting provider.  

Find the file called ‘wp-config.php‘, and open it.  Look for the lines that will connect to the database.  They usually look something like this:

Find the database username and password in the wp-config file, and login to phpmyadmin. Now you can add a new wordpress admin user to regain access to wordpress.

As you can see, your database name is line 23, in this case it’s i2823_wp99.  So that will be the database to edit.  Your username and password are on the lines above on 26, and 29.  

2. Insert user into wp_users table

When you can’t login to the WordPress admin, everything will have to be done through the Database.  

Once logged into phpMyAdmin, on the top left of your screen, locate the database name and click on the link itself.  This should appear directly above ‘Table Schema‘.  Once you click on the link, the database rows will all appear to the right, and directly under it.

phpmyadmin has the users table where you will edit the users of your wordpress or add a wordpress user via phpmyadmin

Find the wp_users table.  This is the table in the database that is responsible for holding the username, password, email address, name etc. of the WordPress users.  Notice in the middle of the screen, you will see multiple tabs on top of the users table.  You are currently on the tab called ‘Structure’, and will need to click on the tab called ‘Browse’ on the top left.

Find the wp_users table inside of your database by clicking on the database name on the top left, and then on the new screen, select the browse tab on the top left of the users table itself. This will allow you to edit the password, email, etc.

Notice all of the users laid out in rows, in the sample above.  IF you are looking to edit a user, find the username you are about to edit, you should see a pencil button to the left which you are going to click.  To create a new user, click the tab above labled ‘insert‘.

If you do not see a wordpress admin user in your database, go to the insert tab, and you will type out a username, password, and other necessary items

Note*  if you do have users listed here, but still cannot login with them, make sure the users that do exist have the number 0 for user_status.  For a working WordPress Admin user, you will need the status to be set to 0.  

cant login to wordpress admin

Fill the fields out as required:

ID: refers to the unique number for each user, if you have no users you may enter the number 1.  In the example 1above, 1-5 were already taken, so we created the number 6.

user_login: is your username, insert a username of your choice.

user_pass:  Enter your password here, create a difficult password, you will have no reminders in the database of password strength, you won’t have the ability to type it twice, so make sure it’s accurate.  Set the column Function drop down to MD5.  This is what encrypts your password.

user_nicename:  The nicename is (usually) a sanitized version of the username.  It’s suppose to be ‘nice’ in the sense that it is the ‘nicename’ that is used as a slug (url trailing after backslash), for example:  digitallythrive.com/blog/author/digitalthrive.  This will also remove any capital letters and so on.

user_email:  Imperative for future password resets, please input a valid email address of this user.  

user_url:  Non important, input a URL or website if you wish.

user_registered:  Non important, but type out the registration date of the user, if you wish.

user_activation_key:  Non important, leave blank if you wish.

user_status:  Imperative to set as 0 for admin capabilities.

display_name:  Input what your name should look like inside of the WordPress dashboard.

Hit the ‘Go‘ button on the bottom right, and this will insert the user.  BEFORE HITTING GO – make sure you select ‘MD5’ under Function, next to user_pass.

 

When you change your password in the WordPress data base for the admin user, make sure you select MD5 for the function, or it will not be encrypted or working.

3. Insert user into wp_usermeta table

After hitting Go, you will have created your first WordPress admin user in phpmyadmin! There is one more step, although we have added a user, we need to give this user permissions to be the administrator.   To do this, we need to find the ‘wp_userneta’ table.   This table stores the permissions of each WordPress user.  

On the lefthand menu, click ‘wp_usermeta‘.  Click ‘Insert‘.

Fill out the following fields, you will need the ID that you created for wp_users, that will go in user_id. 

user_id:  ID you created in previous step. 
meta_key: will be   wp_capabilities  
meta_value: will be    a:1:{s:13:”administrator”;b:1;}    

how to fix usermeta issues in wordpress database

Click Go.  You should get a green Success message.

Next, click Insert on the top again, and fill out the following fields:

user_id:  ID you created in previous step. 
meta_key: will be   wp_user_level  
meta_value: will be    10    

cant login to wordpress admin? Add admin user easily using phpmyadmin

Click Go at the bottom right.  

You should now be able to access the site with your new admin user. If you have issues recheck that each step is done exactly as described.  

If you have a custom database prefix, ensure you’ve done each step in the respective custom prefix table name.  For intsance – if you see wp_usermeta on the left, your table prefix is ‘wp_’, some have custom table prefixes, for security.  For instance, wp_l24dkcE10_usermeta.  Don’t forget to double check these values.

Tags: add wordpress admin cant get into wordperss dashboard cant login to wordpress admin phpmyadmin wordpress user

Post navigation

Previous Previous post:

Best Gaming Laptop for Video Editing

Next Next post:

Blendtec Pro 800 vs. Vitamix 7500

Related Posts

Install RetroPie and Roms on your raspberry pi

Build a Raspberry Pi Super Nintendo – Part 4

By William Sullivan January 6, 2018
interface, internet, program

An Explanation of WordPress SEO

By Bryan Thomas Silverman May 27, 2020
learn how to format a 64GB Micro SD Card into a FAT32 format

How to Format 64GB SD Card from exFAT to FAT32

By William Sullivan August 19, 2018
  • Follow us on Social

    • Facebook
    • VRA breakout pattern spotted, potential cup and handle Crypto VRA Cup & Handle: Possible Breakout Pattern
    • Bitcoins futue price, as shown by the power corridor. Bitcoin News October
    • How to install npm on WSL Windows for Linux. Avoid errors, or a quick fix solution if you have errors already Get NodeJS and Install Npm on WSL
    • How to troubleshoot common errors in WSL, how to fix the broken scroll feature in WSL on Windows. How to scroll up in WSL (Linux for Windows)
    • Install Atom Code Editor and NodeJS on Windows or Mac Install ATOM Code Editor & NodeJS on Windows & Mac
  • The Latest

    • Crypto VRA Cup & Handle: Possible Breakout Pattern October 8, 2021
    • Bitcoin News October October 6, 2021
    • Get NodeJS and Install Npm on WSL October 3, 2021
    • How to scroll up in WSL (Linux for Windows) October 3, 2021
    • Install ATOM Code Editor & NodeJS on Windows & Mac September 26, 2021
  • With by Wordpress News247 Theme
    • Portfolio
    • Buy Domains + Hosting (New)