How to Add an Admin User to the WordPress Database via MySQL



Should you ever get hacked or have a issue with your database there are some things that are useful to know. One powerful tool is the ability to create a new admin user without logging in to your site. In this video, we will show you how to add an admin user to the WordPress database using MySQL.

If you liked this video, then please Like and consider subscribing to our channel for more WordPress videos.

Text version of this tutorial:
http://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-to-the-wordpress-database-via-mysql/

Follow us on Twitter:

Checkout our website for more WordPress Tutorials
http://www.wpbeginner.com/

Summary of this Tutorial:

Start by log gin in to your host’s cpanel

One you log in you will see databases, you may want to back them up before proceeding.

Open the wp_users table and click insert.

Fill in the information and use a md5 password.

With the information filled in click ‘Go’ and it will tell you how many rows were affected with a green check mark.

Next update the wp_usermeta by clicking insert.

Leave the unmeta_id blank

Fill the user_id with the id from before, meta_key will be wp_capabilities, and meta_value will be: a:1:{s:13:”administrator”;s:1:”1″;}

Then fill another row with unmeta_id blank and user_id the one from before.

meta_key will be wp_user_level and meta_value is 10.

Now you will have a new admin user on your site.

Related Links:

How to do a database backup

http://www.wpbeginner.com/beginners-guide/how-to-make-a-wordpress-database-backup-manually/

source

20 thoughts on “How to Add an Admin User to the WordPress Database via MySQL”

  1. Thank you so much… this worked perfectly for me. I have a question, my admin user got deleted from users column by itself. I had nothing to do with it. Thankfully, i created it again using your guide. But why do you think it got deleted in the first place?

Leave a Reply

Your email address will not be published. Required fields are marked *