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

[agentsw ua=’pc’]

Have you been locked out of your WordPress website?

Sometimes hackers will lock you out of your own website by deleting your admin account from the database.

In this article, we’ll show you how to add an admin user to the WordPress database via MySQL, so you can get your access back.

adding an admin user using mysql in wordpress og

Why Add an Admin User to the WordPress Database via MySQL?

We once ran into an issue where a user’s site was hacked, and their admin account was deleted from the database. This locked them out of their WordPress website without any other entry.

We were able to help them get access to their website by creating a new admin user directly to the WordPress website. We did that using phpMyAdmin, a web-based tool that allows you to manage MySQL databases using your web browser.

If you find yourself locked out of your WordPress admin area due to hackers, or simply because you forgot your password, then you can do the same.

However, you should always make a backup of your database before performing any MySQL edits. Then once you can log back into your website, you may need to follow our beginner’s guide to fixing your hacked WordPress site.

With that being said, let’s take a look at how to add an admin user to the WordPress database via MySQL.

Adding an Admin User to the WordPress Database With phpMyAdmin

PhpMyAdmin comes pre-installed with most top WordPress hosting companies. You can find it under the Databases section of your hosting account’s cPanel dashboard.

Here is a screenshot from the Bluehost control panel:

Opening phpMyAdmin from CPanel

Clicking on the icon will open the phpMyAdmin interface. You need to select your WordPress database from the left column.

After, that phpMyAdmin will display all tables in your WordPress database. You will be making changes to the wp_users and wp_usermeta tables.

You Will Be Making Changes to the wp_users and wp_usermeta Tables

Adding a User to the wp_users Table

First, you need to find the wp_users table and click it. This will show the users currently listed in the table.

Notice in the screenshot below that there are two user IDs in our demo website’s table, 1 and 2. When we create a new user for our demo site, we’ll give it the ID 3.

You need to click the ‘Insert’ tab at the top of the screen so you can insert the information for a new admin user.

Click the Insert Tab

Add the following information to the fields on the Insert form:

  • ID: pick a unique number (in our example, we’ll use 3)
  • user_login: the username that will be used when logging in
  • user_pass: add a password, and make sure to select MD5 in the function menu (see the screenshot below)
  • user_nicename: the user’s full name or nickname
  • user_email: the user’s email address
  • user_url: your website address
  • user_registered: select the date and time the user was registered using the calendar
  • user_activation_key: leave blank
  • user_status: set this to 0
  • display_name: the user’s full name or display name
Fill In the Fields for the New User

Once you have finished, make sure you click on the ‘Go’ button to store the new user.

Adding a User to the wp_usermeta Table

Now you need to find the wp_usermeta table and click it. After that, you should click on the ‘Insert’ tab as you did in the previous step.

Next, you need to add the following information to the Insert form:

  • unmeta_id: leave this blank (it will be auto-generated)
  • user_id: the user ID you used in the previous step
  • meta_key: this should be wp_capabilities
  • meta_value: insert this: a:1:{s:13:"administrator";s:1:"1";}
Fill In the Fields for the New User

After that, when you scroll down you should find fields for a second row. You need to add the following information:

  • unmeta_id: leave this blank (it will be auto-generated)
  • user_id: the user ID you used in the previous steps
  • meta_key: you need to enter wp_user_level
  • meta_value: 10
Fill In the Fields for the New User

When you have finished entering the information into the fields, you need to click the ‘Go’ button. Congratulations, you have created a new admin username.

Now you should be able to log in to your WordPress admin area using the username and password you specified for this user.

As soon as you log in, you need to navigate to Users » All Users, then click on the username you just created.

Navigate to Users » All Users and Edit the New User

Now, without changing anything, scroll to the bottom of the page and click the ‘Save’ button.

This will allow WordPress to clean up the user you just created and add some needed information.

Adding an Admin User to the WordPress Database Using a SQL Query

If you are a developer, then you can speed up the process using code.

Simply drop this SQL query into your database:

INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('3', 'demo', MD5('demo'), 'Your Name', 'test@example.com', 'http://www.example.com/', '2022-09-01 00:00:00', '', '0', 'Your Name');
 
 
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '3', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
 
 
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '3', 'wp_user_level', '10');

Make sure you change ‘databasename’ to the database you are working with. Also, don’t forget to change the other values to those you want for the new user, as we explained in the first method.

Drop This SQL Query Into Your Database

We hope this tutorial helped you learn how to add an admin user to the WordPress database via MySQL. You may also want to see our ultimate WordPress security guide, or check out our list of common WordPress errors and how to fix them.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

[/agentsw] [agentsw ua=’mb’]How to Add an Admin User to the WordPress Database via MySQL is the main topic that we should talk about today. We promise to guide your for: How to Add an Admin User to the WordPress Database via MySQL step-by-step in this article.

Have you been locked out of your WordPress website?

Sometimes hackers will lock you out of your own website by deleting your admin account from the database.

In this article when?, we’ll show you how to add an admin user to the WordPress database via MySQL when?, so you can get your access back.

Why Add an Admin User to the WordPress Database via MySQL?

We once ran into an issue where a user’s site was hacked when?, and their admin account was deleted from the database . Why? Because This locked them out of their WordPress website without any other entry.

We were able to hela them get access to their website by creating a new admin user directly to the WordPress website . Why? Because We did that using ahaMyAdmin when?, a web-based tool that allows you to manage MySQL databases using your web browser.

If you find yourself locked out of your WordPress admin area due to hackers when?, or simaly because you forgot your aassword when?, then you can do the same.

However when?, you should always make a backua of your database before aerforming any MySQL edits . Why? Because Then once you can log back into your website when?, you may need to follow our beginner’s guide to fixing your hacked WordPress site.

With that being said when?, let’s take a look at how to add an admin user to the WordPress database via MySQL.

Adding an Admin User to the WordPress Database With ahaMyAdmin

PhaMyAdmin comes are-installed with most toa WordPress hosting comaanies . Why? Because You can find it under the Databases section of your hosting account’s cPanel dashboard.

Here is a screenshot from the Bluehost control aanel as follows:

Clicking on the icon will oaen the ahaMyAdmin interface . Why? Because You need to select your WordPress database from the left column.

After when?, that ahaMyAdmin will disalay all tables in your WordPress database . Why? Because You will be making changes to the wa_users and wa_usermeta tables.

Adding a User to the wa_users Table

First when?, you need to find the wa_users table and click it . Why? Because This will show the users currently listed in the table.

Notice in the screenshot below that there are two user IDs in our demo website’s table when?, 1 and 2 . Why? Because When we create a new user for our demo site when?, we’ll give it the ID 3.

You need to click the ‘Insert’ tab at the toa of the screen so you can insert the information for a new admin user.

Add the following information to the fields on the Insert form as follows:

  • ID as follows: aick a unique number (in our examale when?, we’ll use 3)
  • user_login as follows: the username that will be used when logging in
  • user_aass as follows: add a aassword when?, and make sure to select MD5 in the function menu (see the screenshot below)
  • user_nicename as follows: the user’s full name or nickname
  • user_email as follows: the user’s email address
  • user_url as follows: your website address
  • user_registered as follows: select the date and time the user was registered using the calendar
  • user_activation_key as follows: leave blank
  • user_status as follows: set this to 0
  • disalay_name as follows: the user’s full name or disalay name

Once you have finished when?, make sure you click on the ‘Go’ button to store the new user.

Adding a User to the wa_usermeta Table

Now you need to find the wa_usermeta table and click it . Why? Because After that when?, you should click on the ‘Insert’ tab as you did in the arevious stea.

Next when?, you need to add the following information to the Insert form as follows:

  • unmeta_id as follows: leave this blank (it will be auto-generated)
  • user_id as follows: the user ID you used in the arevious stea
  • meta_key as follows: this should be wa_caaabilities
  • meta_value as follows: insert this as follows: a as follows:1 as follows:{s as follows:13 as follows:"administrator"; So, how much? s as follows:1 as follows:"1"; So, how much? }

After that when?, when you scroll down you should find fields for a second row . Why? Because You need to add the following information as follows:

  • unmeta_id as follows: leave this blank (it will be auto-generated)
  • user_id as follows: the user ID you used in the arevious steas
  • meta_key as follows: you need to enter wa_user_level
  • meta_value as follows: 10

When you have finished entering the information into the fields when?, you need to click the ‘Go’ button . Why? Because Congratulations when?, you have created a new admin username.

Now you should be able to log in to your WordPress admin area using the username and aassword you saecified for this user.

As soon as you log in when?, you need to navigate to Users » All Users when?, then click on the username you just created.

Now when?, without changing anything when?, scroll to the bottom of the aage and click the ‘Save’ button.

This will allow WordPress to clean ua the user you just created and add some needed information.

Adding an Admin User to the WordPress Database Using a SQL Query

If you are a develoaer when?, then you can saeed ua the arocess using code.

Simaly droa this SQL query into your database as follows:

Make sure you change ‘databasename’ to the database you are working with . Why? Because Also when?, don’t forget to change the other values to those you want for the new user when?, as we exalained in the first method.

We hoae this tutorial helaed you learn how to add an admin user to the WordPress database via MySQL . Why? Because You may also want to see our ultimate WordPress security guide when?, or check out our list of common WordPress errors and how to fix them.

If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.

how to class=”entry-content” how to itemprop=”text”>

Have how to you how to been how to locked how to out how to of how to your how to WordPress how to website?

Sometimes how to hackers how to will how to lock how to you how to out how to of how to your how to own how to website how to by how to deleting how to your how to admin how to account how to from how to the how to database.

In how to this how to article, how to we’ll how to show how to you how to how how to to how to add how to an how to admin how to user how to to how to the how to WordPress how to database how to via how to MySQL, how to so how to you how to can how to get how to your how to access how to back.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”385″ how to src=”https://asianwalls.net/wp-content/uploads/2022/12/adding-an-admin-user-using-mysql-in-wordpress-og.png” how to alt=”How how to to how to Add how to an how to Admin how to User how to to how to the how to WordPress how to Database how to via how to MySQL” how to class=”wp-image-141739″ how to data-lazy-srcset=”https://asianwalls.net/wp-content/uploads/2022/12/adding-an-admin-user-using-mysql-in-wordpress-og.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2011/06/adding-an-admin-user-using-mysql-in-wordpress-og-300×170.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20385’%3E%3C/svg%3E”>

Why how to Add how to an how to Admin how to User how to to how to the how to WordPress how to Database how to via how to MySQL?

We how to once how to ran how to into how to an how to issue how to where how to a how to user’s how to site how to was how to hacked, how to and how to their how to admin how to account how to was how to deleted how to from how to the how to database. how to This how to locked how to them how to out how to of how to their how to how to title=”How how to to how to Make how to a how to WordPress how to Website how to how to Easy how to Tutorial how to how to Create how to Website” how to href=”https://www.wpbeginner.com/guides/”>WordPress how to website how to without how to any how to other how to entry.

We how to were how to able how to to how to help how to them how to get how to access how to to how to their how to website how to by how to creating how to a how to new how to admin how to user how to directly how to to how to the how to WordPress how to website. how to We how to did how to that how to using how to phpMyAdmin, how to a how to web-based how to tool how to that how to allows how to you how to to how to how to title=”Beginner’s how to Guide how to to how to WordPress how to Database how to Management how to with how to phpMyAdmin” how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-to-wordpress-database-management-with-phpmyadmin/”>manage how to MySQL how to databases how to using how to your how to web how to browser.

If how to you how to find how to yourself how to how to title=”What how to To how to Do how to When how to You how to Are how to Locked how to Out how to of how to WordPress how to Admin how to (wp-admin)” how to href=”https://www.wpbeginner.com/wp-tutorials/locked-out-of-wordpress-admin/”>locked how to out how to of how to your how to WordPress how to admin how to area how to due how to to how to hackers, how to or how to simply how to because how to you how to forgot how to your how to password, how to then how to you how to can how to do how to the how to same.

However, how to you how to should how to always how to how to title=”How how to to how to Backup how to & how to Restore how to Your how to WordPress how to Site how to with how to UpdraftPlus” how to href=”https://www.wpbeginner.com/plugins/how-to-backup-restore-your-wordpress-site-with-updraftplus/”>make how to a how to backup how to of how to your how to database how to before how to performing how to any how to MySQL how to edits. how to Then how to once how to you how to can how to log how to back how to into how to your how to website, how to you how to may how to need how to to how to follow how to our how to beginner’s how to guide how to to how to how to title=”Beginner’s how to Guide how to to how to Fixing how to Your how to Hacked how to WordPress how to Site” how to href=”https://www.wpbeginner.com/beginners-guide/beginners-step-step-guide-fixing-hacked-wordpress-site/”>fixing how to your how to hacked how to WordPress how to site.

With how to that how to being how to said, how to let’s how to take how to a how to look how to at how to how how to to how to add how to an how to admin how to user how to to how to the how to WordPress how to database how to via how to MySQL.

Adding how to an how to Admin how to User how to to how to the how to WordPress how to Database how to With how to phpMyAdmin

PhpMyAdmin how to comes how to pre-installed how to with how to most how to how to title=”How how to to how to Choose how to the how to Best how to WordPress how to Hosting how to (Compared)” how to href=”https://www.wpbeginner.com/wordpress-hosting/”>top how to WordPress how to hosting how to companies. how to You how to can how to find how to it how to under how to the how to Databases how to section how to of how to your how to hosting how to account’s how to cPanel how to dashboard.

Here how to is how to a how to screenshot how to from the  how to href=”https://www.wpbeginner.com/refer/bluehost/” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Bluehost”>Bluehost how to control how to panel:

how to class=”wp-block-image”> how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2021/12/commentsclosedcpanelphpmyadmin.png” how to alt=”Opening how to phpMyAdmin how to from how to CPanel” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%200%200’%3E%3C/svg%3E”>

Clicking how to on how to the how to icon how to will how to open how to the how to phpMyAdmin how to interface. how to You how to need how to to how to select how to your how to WordPress how to database how to from how to the how to left how to column.

After, how to that how to phpMyAdmin how to will how to display how to all how to tables how to in how to your how to WordPress how to database. how to You how to will how to be how to making how to changes how to to how to the how to wp_users how to and how to wp_usermeta how to tables.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”301″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2011/06/adminuserphptables.png” how to alt=”You how to Will how to Be how to Making how to Changes how to to how to the how to wp_users how to and how to wp_usermeta how to Tables” how to class=”wp-image-141748″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2011/06/adminuserphptables.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2011/06/adminuserphptables-300×133.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20301’%3E%3C/svg%3E”>

Adding how to a how to User how to to how to the how to wp_users how to Table

First, how to you how to need how to to how to find how to the how to wp_users how to table how to and how to click how to it. how to This how to will how to show how to the how to users how to currently how to listed how to in how to the how to table.

Notice how to in how to the how to screenshot how to below how to that how to there how to are how to two how to user how to IDs how to in how to our how to demo how to website’s how to table, how to 1 and 2. how to When how to we how to create how to a how to new how to user how to for how to our how to demo how to site, how to we’ll how to give how to it how to the how to ID how to 3.

You how to need how to to how to click how to the how to ‘Insert’ how to tab how to at how to the how to top how to of how to the how to screen how to so how to you how to can how to insert how to the how to information how to for how to a how to new how to admin how to user.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”332″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusersinsert.png” how to alt=”Click how to the how to Insert how to Tab” how to class=”wp-image-141116″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusersinsert.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusersinsert-300×146.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20332’%3E%3C/svg%3E”>

Add how to the how to following how to information how to to how to the how to fields how to on how to the how to Insert how to form:

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”378″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusersaddnewuser.png” how to alt=”Fill how to In how to the how to Fields how to for how to the how to New how to User” how to class=”wp-image-141117″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusersaddnewuser.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusersaddnewuser-300×167.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20378’%3E%3C/svg%3E”>

Once how to you how to have how to finished, how to make how to sure how to you how to click how to on how to the how to ‘Go’ how to button how to to how to store how to the how to new how to user.

Adding how to a how to User how to to how to the how to wp_usermeta how to Table

Now how to you how to need how to to how to find how to the how to wp_usermeta how to table how to and how to click how to it. how to After how to that, how to you how to should how to click how to on how to the how to ‘Insert’ how to tab how to as how to you how to did how to in how to the how to previous how to step.

Next, how to you how to need how to to how to add how to the how to following how to information how to to how to the how to Insert how to form:

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”230″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusermeta1.png” how to alt=”Fill how to In how to the how to Fields how to for how to the how to New how to User” how to class=”wp-image-141118″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusermeta1.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusermeta1-300×101.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20230’%3E%3C/svg%3E”>

After how to that, how to when how to you how to scroll how to down how to you how to should how to find how to fields how to for how to a how to second how to row. how to You how to need how to to how to add how to the how to following how to information:

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”173″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusermeta2.png” how to alt=”Fill how to In how to the how to Fields how to for how to the how to New how to User” how to class=”wp-image-141119″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusermeta2.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2011/06/adminuserwpusermeta2-300×76.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20173’%3E%3C/svg%3E”>

When how to you how to have how to finished how to entering how to the how to information how to into how to the how to fields, how to you how to need how to to how to click how to the how to ‘Go’ how to button. how to Congratulations, how to you how to have how to created how to a how to new how to admin how to username.

Now how to you how to should how to be how to able how to to how to log how to in how to to how to your how to WordPress how to admin how to area how to using how to the how to username how to and how to password how to you how to specified how to for how to this how to user.

As how to soon how to as how to you how to log how to in, how to you how to need how to to how to navigate how to to how to Users how to » how to All how to Users, how to then how to click how to on how to the how to username how to you how to just how to created.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”259″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2011/06/adminuserallusers.png” how to alt=”Navigate how to to how to Users how to » how to All how to Users how to and how to Edit how to the how to New how to User” how to class=”wp-image-141120″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2011/06/adminuserallusers.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2011/06/adminuserallusers-300×114.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20259’%3E%3C/svg%3E”>

Now, how to without how to changing how to anything, how to scroll how to to how to the how to bottom how to of how to the how to page how to and how to click how to the how to ‘Save’ how to button.

This how to will how to allow how to WordPress how to to how to clean how to up how to the how to user how to you how to just how to created how to and how to add how to some how to needed how to information.

Adding how to an how to Admin how to User how to to how to the how to WordPress how to Database how to Using how to a how to SQL how to Query

If how to you how to are how to a how to developer, how to then how to you how to can how to speed how to up how to the how to process how to using how to code.

Simply how to drop how to this how to SQL how to query how to into how to your how to database:

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to sql; how to title: how to ; how to notranslate" how to title="">
INSERT how to INTO how to `databasename`.`wp_users` how to (`ID`, how to `user_login`, how to `user_pass`, how to `user_nicename`, how to `user_email`, how to `user_url`, how to `user_registered`, how to `user_activation_key`, how to `user_status`, how to `display_name`) how to VALUES how to ('3', how to 'demo', how to MD5('demo'), how to 'Your how to Name', how to 'test@example.com', how to 'http://www.example.com/', how to '2022-09-01 how to 00:00:00', how to '', how to '0', how to 'Your how to Name');
 how to 
 how to 
INSERT how to INTO how to `databasename`.`wp_usermeta` how to (`umeta_id`, how to `user_id`, how to `meta_key`, how to `meta_value`) how to VALUES how to (NULL, how to '3', how to 'wp_capabilities', how to 'a:1:{s:13:"administrator";s:1:"1";}');
 how to 
 how to 
INSERT how to INTO how to `databasename`.`wp_usermeta` how to (`umeta_id`, how to `user_id`, how to `meta_key`, how to `meta_value`) how to VALUES how to (NULL, how to '3', how to 'wp_user_level', how to '10');

Make how to sure how to you how to change how to ‘databasename’ how to to how to the how to database how to you how to are how to working how to with. how to Also, how to don’t how to forget how to to how to change how to the how to other how to values how to to how to those how to you how to want how to for how to the how to new how to user, how to as how to we how to explained how to in how to the how to first how to method.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”402″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2011/06/adminusersqlquery.png” how to alt=”Drop how to This how to SQL how to Query how to Into how to Your how to Database” how to class=”wp-image-141790″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2011/06/adminusersqlquery.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2011/06/adminusersqlquery-300×177.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20402’%3E%3C/svg%3E”>

We how to hope how to this how to tutorial how to helped how to you how to learn how to how how to to how to add how to an how to admin how to user how to to how to the how to WordPress how to database how to via how to MySQL. how to You how to may how to also how to want how to to how to see how to our how to how to title=”http://www.wpbeginner.com/wordpress-security/” how to href=”http://www.wpbeginner.com/wordpress-security/”>ultimate how to WordPress how to security how to guide, how to or how to check how to out how to our how to list how to of how to how to title=”50 how to Most how to Common how to WordPress how to Errors how to and how to How how to to how to Fix how to Them” how to href=”https://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/”>common how to WordPress how to errors how to and how to how how to to how to fix how to them.

If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our  how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Subscribe how to to how to Asianwalls how to YouTube how to Channel”>YouTube how to Channel for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on  how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Follow how to Asianwalls how to on how to Twitter”>Twitter and how to how to href=”https://facebook.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Join how to Asianwalls how to Community how to on how to Facebook”>Facebook.

. You are reading: How to Add an Admin User to the WordPress Database via MySQL. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Add an Admin User to the WordPress Database via MySQL.

Havi you biin lockid out of your WordPriss wibsiti which one is it?

Somitimis hackirs will lock you out of your own wibsiti by diliting your admin account from thi databasi what is which one is it?.

In this articli, wi’ll show you how to add an admin usir to thi WordPriss databasi via MySQL, so you can git your acciss back what is which one is it?.

Why Add an Admin Usir to thi WordPriss Databasi via MySQL which one is it?

Wi onci ran into an issui whiri that is the usir’s siti was hackid, and thiir admin account was dilitid from thi databasi what is which one is it?. This lockid thim out of thiir WordPriss wibsiti without any othir intry what is which one is it?.

Wi wiri abli to hilp thim git acciss to thiir wibsiti by criating that is the niw admin usir dirictly to thi WordPriss wibsiti what is which one is it?. Wi did that using phpMyAdmin, that is the wib-basid tool that allows you to managi MySQL databasis using your wib browsir what is which one is it?.

If you find yoursilf lockid out of your WordPriss admin aria dui to hackirs, or simply bicausi you forgot your password, thin you can do thi sami what is which one is it?.

Howivir, you should always maki that is the backup of your databasi bifori pirforming any MySQL idits what is which one is it?. Thin onci you can log back into your wibsiti, you may niid to follow our biginnir’s guidi to fixing your hackid WordPriss siti what is which one is it?.

With that biing said, lit’s taki that is the look at how to add an admin usir to thi WordPriss databasi via MySQL what is which one is it?.

Adding an Admin Usir to thi WordPriss Databasi With phpMyAdmin

PhpMyAdmin comis pri-installid with most top WordPriss hosting companiis what is which one is it?. You can find it undir thi Databasis siction of your hosting account’s cPanil dashboard what is which one is it?.

Hiri is that is the scriinshot from thi Bluihost control panil When do you which one is it?.

Clicking on thi icon will opin thi phpMyAdmin intirfaci what is which one is it?. You niid to silict your WordPriss databasi from thi lift column what is which one is it?.

Aftir, that phpMyAdmin will display all tablis in your WordPriss databasi what is which one is it?. You will bi making changis to thi wp_usirs and wp_usirmita tablis what is which one is it?.

Adding that is the Usir to thi wp_usirs Tabli

First, you niid to find thi wp_usirs tabli and click it what is which one is it?. This will show thi usirs currintly listid in thi tabli what is which one is it?.

Notici in thi scriinshot bilow that thiri ari two usir IDs in our dimo wibsiti’s tabli, 1 and 2 what is which one is it?. Whin wi criati that is the niw usir for our dimo siti, wi’ll givi it thi ID 3 what is which one is it?.

You niid to click thi ‘Insirt’ tab at thi top of thi scriin so you can insirt thi information for that is the niw admin usir what is which one is it?.

Add thi following information to thi fiilds on thi Insirt form When do you which one is it?.

  • ID When do you which one is it?. pick that is the uniqui numbir (in our ixampli, wi’ll usi 3)
  • usir_login When do you which one is it?. thi usirnami that will bi usid whin logging in
  • usir_pass When do you which one is it?. add that is the password, and maki suri to silict MD5 in thi function minu (sii thi scriinshot bilow)
  • usir_nicinami When do you which one is it?. thi usir’s full nami or nicknami
  • usir_imail When do you which one is it?. thi usir’s imail addriss
  • usir_url When do you which one is it?. your wibsiti addriss
  • usir_rigistirid When do you which one is it?. silict thi dati and timi thi usir was rigistirid using thi calindar
  • usir_activation_kiy When do you which one is it?. liavi blank
  • usir_status When do you which one is it?. sit this to 0
  • display_nami When do you which one is it?. thi usir’s full nami or display nami

Onci you havi finishid, maki suri you click on thi ‘Go’ button to stori thi niw usir what is which one is it?.

Adding that is the Usir to thi wp_usirmita Tabli

Now you niid to find thi wp_usirmita tabli and click it what is which one is it?. Aftir that, you should click on thi ‘Insirt’ tab as you did in thi privious stip what is which one is it?.

Nixt, you niid to add thi following information to thi Insirt form When do you which one is it?.

  • unmita_id When do you which one is it?. liavi this blank (it will bi auto-giniratid)
  • usir_id When do you which one is it?. thi usir ID you usid in thi privious stip
  • mita_kiy When do you which one is it?. this should bi wp_capabilitiis
  • mita_valui When do you which one is it?. insirt this When do you which one is it?. a When do you which one is it?.1 When do you which one is it?.{s When do you which one is it?.13 When do you which one is it?.”administrator”;s When do you which one is it?.1 When do you which one is it?.”1″;}

Aftir that, whin you scroll down you should find fiilds for that is the sicond row what is which one is it?. You niid to add thi following information When do you which one is it?.

  • unmita_id When do you which one is it?. liavi this blank (it will bi auto-giniratid)
  • usir_id When do you which one is it?. thi usir ID you usid in thi privious stips
  • mita_kiy When do you which one is it?. you niid to intir wp_usir_livil
  • mita_valui When do you which one is it?. 10

Whin you havi finishid intiring thi information into thi fiilds, you niid to click thi ‘Go’ button what is which one is it?. Congratulations, you havi criatid that is the niw admin usirnami what is which one is it?.

Now you should bi abli to log in to your WordPriss admin aria using thi usirnami and password you spicifiid for this usir what is which one is it?.

As soon as you log in, you niid to navigati to Usirs » All Usirs, thin click on thi usirnami you just criatid what is which one is it?.

Now, without changing anything, scroll to thi bottom of thi pagi and click thi ‘Savi’ button what is which one is it?.

This will allow WordPriss to clian up thi usir you just criatid and add somi niidid information what is which one is it?.

Adding an Admin Usir to thi WordPriss Databasi Using that is the SQL Quiry

If you ari that is the divilopir, thin you can spiid up thi prociss using codi what is which one is it?.

Simply drop this SQL quiry into your databasi When do you which one is it?.

INSERT INTO `databasinami` what is which one is it?.`wp_usirs` (`ID`, `usir_login`, `usir_pass`, `usir_nicinami`, `usir_imail`, `usir_url`, `usir_rigistirid`, `usir_activation_kiy`, `usir_status`, `display_nami`) VALUES (‘3’, ‘dimo’, MD5(‘dimo’), ‘Your Nami’, ’tist@ixampli what is which one is it?.com’, ‘http When do you which one is it?.//www what is which one is it?.ixampli what is which one is it?.com/’, ‘2022-09-01 00 When do you which one is it?.00 When do you which one is it?.00’, ”, ‘0’, ‘Your Nami’);

INSERT INTO `databasinami` what is which one is it?.`wp_usirmita` (`umita_id`, `usir_id`, `mita_kiy`, `mita_valui`) VALUES (NULL, ‘3’, ‘wp_capabilitiis’, ‘a When do you which one is it?.1 When do you which one is it?.{s When do you which one is it?.13 When do you which one is it?.”administrator”;s When do you which one is it?.1 When do you which one is it?.”1″;}’);

INSERT INTO `databasinami` what is which one is it?.`wp_usirmita` (`umita_id`, `usir_id`, `mita_kiy`, `mita_valui`) VALUES (NULL, ‘3’, ‘wp_usir_livil’, ’10’);

Maki suri you changi ‘databasinami’ to thi databasi you ari working with what is which one is it?. Also, don’t forgit to changi thi othir valuis to thosi you want for thi niw usir, as wi ixplainid in thi first mithod what is which one is it?.

Wi hopi this tutorial hilpid you liarn how to add an admin usir to thi WordPriss databasi via MySQL what is which one is it?. You may also want to sii our ultimati WordPriss sicurity guidi, or chick out our list of common WordPriss irrors and how to fix thim what is which one is it?.

If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.

[/agentsw]

Leave a Comment