{"id":19069,"date":"2021-01-20T17:00:05","date_gmt":"2021-01-20T16:00:05","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=19069"},"modified":"2021-01-19T11:16:40","modified_gmt":"2021-01-19T10:16:40","slug":"phpmyadmin-add-user","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/phpmyadmin-add-user\/","title":{"rendered":"How to Add a User to the WordPress Database via phpMyAdmin"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]Losing access to a website\u2019s dashboard has happened to every WordPress user that takes part in website creation at least once. Most often, it\u2019s a matter of a forgotten password. In that case, you can easily <a href=\"https:\/\/qodeinteractive.com\/magazine\/recover-wordpress-password\/\">recover the password<\/a> using the recovery email or by changing it directly in the database.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]However, in other, less frequent cases, regaining access to the dashboard can be quite a problem. Admin accounts are impacted the most by this, as they have the most privileges. These other reasons for losing access to the dashboard include accidentally deleting the user account or your website getting hacked, which can result in some accounts, including your only admin account, being deleted.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]It\u2019s also possible that you only had one admin account tied to your previous webmaster, whose departure left you unable to log in to your admin dashboard or any of your non-admin accounts.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Knowing how to add a WordPress user via phpMyAdmin can come in handy in those situations. This is particularly relevant for adding admin accounts and as such, they will be the main focus of this article. However, we will also show you how to add accounts with default (non-admin) user roles should you need to do so outside of your dashboard.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;80px&#8221;][vc_widget_sidebar sidebar_id=&#8221;new-top-picks-banner&#8221;][vc_empty_space height=&#8221;81px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">How to add a user to the WordPress database via phpMyAdmin<\/h2>\n<p>[\/vc_column_text][vc_column_text]Since we already touched on why it would be useful to know other means of regaining access to your dashboard, let\u2019s now delve into how to do it. To be able to apply our suggested methods, you will need to have access to your web hosting control panel. We will be using cPanel in our examples.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In the following section, we will show you how to add a WordPress user via phpMyAdmin and how to assign them admin privileges. We will also discuss how the process will differ if you wanted to assign other, non-admin privileges. Since this guide requires you to edit your database directly, <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-backup-wordpress-database\/\">making a backup of it<\/a> beforehand is highly advisable.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"add-admin-user\"><\/a>How to add an admin user to the WordPress database via phpMyAdmin<\/h3>\n<p>[\/vc_column_text][vc_column_text]First,<strong> connect to cPanel<\/strong> using your cPanel credentials and <strong>click on the <em>phpMyAdmin<\/em> option<\/strong>, located in the <em>Databases<\/em> section near the top of your screen.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Databases-phpMyAdmin.jpg\" class=\"attachment-full size-full\" alt=\"Databases phpMyAdmin\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Databases-phpMyAdmin.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Databases-phpMyAdmin-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Databases-phpMyAdmin-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Databases-phpMyAdmin-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Having clicked it, phpMyAdmin will open in a separate tab. <strong>Find your database<\/strong> in the menu on the left and click on it to open, then <strong>find the wp_users table<\/strong> and <strong>click on it<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"550\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Database-wp_users.jpg\" class=\"attachment-full size-full\" alt=\"Database wp_users\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Database-wp_users.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Database-wp_users-300x170.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Database-wp_users-768x436.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Database-wp_users-620x352.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Before we go any further, we should quickly address two issues you might run into while performing the steps outlined above.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><strong>Not knowing your database name<\/strong><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you have forgotten your database name, you shouldn\u2019t worry\u2014it is stored in the wp-config.php file. To find it, you only need to take a look at the wp-config.php file and search for a line of code that specifies your database name.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To do so,<strong> return to the main view of your server control panel<\/strong> and <strong>click on the <em>File Manager<\/em> option<\/strong> located in the top section of your screen.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Files-File-Manager.jpg\" class=\"attachment-full size-full\" alt=\"Files File Manager\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Files-File-Manager.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Files-File-Manager-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Files-File-Manager-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Files-File-Manager-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]In the tab that opens, <strong>find your website<\/strong> and <strong>navigate to its root WordPress directory<\/strong>, often called public_html. Afterward, <strong>locate the wp-config.php file, click on it<\/strong>, and <strong>select the <em>View<\/em> option from the dropdown.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-config.jpg\" class=\"attachment-full size-full\" alt=\"wp-config\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-config.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-config-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-config-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-config-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]This will let you see the content of the wp-config.php file. Within the section containing MySQL settings, which is located near the top of the file, look for a line of code that has your database name. It will be in the following form:<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">define( 'DB_NAME', 'your-database-name-here' );<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]The part with \u2018<em>your-database-name-here<\/em>\u2019 will be replaced with the actual name of your database.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-config-php.jpg\" class=\"attachment-full size-full\" alt=\"wp-config php\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-config-php.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-config-php-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-config-php-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-config-php-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><strong>The database prefix has been changed<\/strong><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Some users can decide to <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-change-wordpress-database-prefix\/\">change the default WordPress database prefix<\/a> (which is<em><strong> wp_<\/strong><\/em>) for security reasons. If that\u2019s the case with you as well, you should look for the database table called yourprefix_users, instead of wp_users. Please note, the part with <em>yourprefix_<\/em> will be replaced with your custom prefix. Knowing your database prefix is very important and will be mentioned several times throughout the article.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]With that being said, we can continue with our guide on using phpMyAdmin to add an admin WordPress user. <strong>After accessing the <em>users<\/em> table, you will be placed within the <em>Browse<\/em> tab. Click on the <em>Insert<\/em> tab<\/strong> in the top section of your screen, instead.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/phpMyAdmin-Insert.jpg\" class=\"attachment-full size-full\" alt=\"phpMyAdmin Insert\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/phpMyAdmin-Insert.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/phpMyAdmin-Insert-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/phpMyAdmin-Insert-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/phpMyAdmin-Insert-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]To add a user, <strong>you will need to fill out the values of the columns shown on the <em>Insert<\/em> tab<\/strong>. Let us briefly cover what those are:[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]- ID \u2013 unique number assigned to a user when it\u2019s created,<br \/>\n&#8211; user_login \u2013 username for the user you wish to create,<br \/>\n&#8211; user_pass \u2013 password for the user you wish to create,<br \/>\n&#8211; user_nicename \u2013 a name that the user will be referred by,<br \/>\n&#8211; user_email \u2013 email for the user you wish to create,<br \/>\n&#8211; user_url \u2013 user\u2019s URL if they have a site or social media profile they wish to link,<br \/>\n&#8211; user_registered \u2013 the date when the user is created,<br \/>\n&#8211; user_activation_key \u2013 key used for authentication when resetting the password,<br \/>\n&#8211; user_status \u2013 a number determining the user\u2019s status (currently deprecated), and<br \/>\n&#8211; display_name \u2013 the name of the user that is displayed on the website.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To add a new user, you will need to fill in the following fields: <strong>user_login, user_pass (while selecting the MD5 encryption function), user_nicename, user_email, user_url, user_registered, and display_name.<\/strong> When you\u2019re done adding the required information, <strong>press the <em>Go<\/em> button below<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"563\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Add-New-User.jpg\" class=\"attachment-full size-full\" alt=\"Add New User\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Add-New-User.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Add-New-User-300x174.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Add-New-User-768x446.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Add-New-User-620x360.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Other than the options we mentioned, we have left the others set to their default values. Of the three remaining options, <strong>the ID<\/strong> is the most important and <strong>will be automatically generated after the user has been created.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Wait until the creation process finishes; you will see a success message similar to the one shown below.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message.jpg\" class=\"attachment-full size-full\" alt=\"Success Message\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Afterward, <strong>click on the Browse tab to access it<\/strong> once more. Here you can see the ID of the newly created user; you will need this information for later, so make sure you memorize it. In our case, it was 17.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/User-ID.jpg\" class=\"attachment-full size-full\" alt=\"User ID\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/User-ID.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/User-ID-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/User-ID-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/User-ID-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Then, <strong>return to the main screen of your database<\/strong> and <strong>click on the <em>wp_usermeta<\/em> table<\/strong> to access it. As we mentioned previously, if you changed the default WordPress database prefix (wp_), then you should look for the table named yourprefix_usermeta.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta.jpg\" class=\"attachment-full size-full\" alt=\"wp-usermeta\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Next, <strong>click on the <em>Insert<\/em> tab<\/strong>. You will see a screen similar to the one below, with two sections where you need to add data.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"815\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Insert-Tab.jpg\" class=\"attachment-full size-full\" alt=\"Insert Tab\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Insert-Tab.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Insert-Tab-300x252.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Insert-Tab-768x646.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Insert-Tab-620x521.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]This is the final and most important step\u2014<strong>assigning a user role to the newly created user<\/strong>. <strong>All the steps we described so far will be the same when you create any new user, no matter the role it will have.<\/strong> Now let\u2019s take a look at how you can assign admin privileges to your new user.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In the first section, <strong>add the ID<\/strong> you previously memorized <strong>as the value of the user_id column<\/strong>. Then set <strong><em>wp_capabilities<\/em> as the value of the meta_key column<\/strong>. Finally, add the following code <strong>as the value of the meta_value column:<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">a:1:{s:13:\"administrator\";b:1;}<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you have changed the database prefix, then you would also need to change the <em>wp_<\/em> part in <em>wp_capabilities<\/em> to match your custom prefix.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-Values.jpg\" class=\"attachment-full size-full\" alt=\"wp-usermeta Values\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-Values.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-Values-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-Values-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-Values-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Afterward, <strong>scroll down to the second section. Add the user_id<\/strong> once more,<strong> set <em>wp_user_level<\/em> as the value of the meta_key, and insert 10 as the value of the meta_value column.<\/strong> Then, <strong>press the <em>Go<\/em> button<\/strong> to assign admin privileges to this new user.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"603\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Enter-Values.jpg\" class=\"attachment-full size-full\" alt=\"Enter Values\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Enter-Values.jpg 975w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Enter-Values-300x186.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Enter-Values-768x475.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Enter-Values-970x600.jpg 970w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Enter-Values-620x383.jpg 620w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Shortly after, <strong>you will see a success message in the form of the query that was run thanks to the data you inserted.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-3.jpg\" class=\"attachment-full size-full\" alt=\"Success Message\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-3.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-3-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-3-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-3-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Afterward, <strong>you can log in to your website with the new username and password<\/strong> you created and regain access to your website if you lost it before. You can use this new administrator user as you see fit, including using it to recover your previous admin account.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\">How to add a user with a non-admin user role to the WordPress database via phpMyAdmin<\/h3>\n<p>[\/vc_column_text][vc_column_text]As we mentioned before, <strong>the process of creating any user is the same in phpMyAdmin. The only difference between an admin and any other user role is the data inserted in the <em>wp_usermeta<\/em> table.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Therefore, <strong>we suggest you review <a href=\"#add-admin-user\">the previous section<\/a> first<\/strong> to learn how you can create a user. <strong>You can follow the same steps up to the part with accessing the <em>wp_usermeta<\/em> table.<\/strong> At the point when you <strong>access the <em>wp_usermeta<\/em> table<\/strong>, you should <strong>switch to the <em>Insert<\/em> tab<\/strong>. You will see a view similar to the one below, showing two subsections.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"815\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Insert-Tab.jpg\" class=\"attachment-full size-full\" alt=\"Insert Tab\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Insert-Tab.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Insert-Tab-300x252.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Insert-Tab-768x646.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Insert-Tab-620x521.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]In the top subsection, <strong>you should insert the ID of the user you created as the value for the user_id column<\/strong>. Also, <strong>type in <em>wp_capabilities<\/em> in the value field of the meta_key column.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Then, <strong>scroll down to the bottom subsection<\/strong> and <strong>insert the ID of your user in the value field of the user_id column<\/strong>. Set <strong><em>wp_user_level<\/em> in the value field of the meta_key column<\/strong>. If you followed along for the part of this article that described assigning an admin user role, then you probably <strong>noticed that the steps we are taking are the same. This is because different user roles are assigned to users based on the inputs in the meta_value fields associated with <em>wp_capabilities<\/em> and the <em>wp_user_role<\/em> meta_keys, respectively.<\/strong> Below, you can see the input for those fields for all default non-admin user roles.[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><strong>Subscriber<\/strong><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wp_capabilities:\r\na:1:{s:10:\"subscriber\";b:1;}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wp_user_role:\r\n0<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><strong>Contributor<\/strong><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wp_capabilities:\r\na:1:{s:11:\"contributor\";b:1;}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wp_user_role:\r\n1<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><strong>Author<\/strong><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wp_capabilities:\r\na:1:{s:6:\"author\";b:1;}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wp_user_role:\r\n2<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><strong>Editor<\/strong><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wp_capabilities:\r\na:1:{s:6:\"editor\";b:1;}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wp_user_role:\r\n7<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Let us explain this in more detail using an example.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>If we wanted to assign the subscriber user role to our new user, we would insert<\/strong> a:1:{s:10:&#8221;subscriber&#8221;;b:1;} <strong>into the value field of the meta_value column, which is directly below the <em>wp_capabilities<\/em> meta_key value. Also, we would insert 0 in the value field of the meta_value column, which is directly below the <em>wp_user_role<\/em> meta_key value.<\/strong> Afterward, <strong>press the <em>Go<\/em> button<\/strong> to finish the process.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-Values.jpg\" class=\"attachment-full size-full\" alt=\"wp-usermeta Values\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-Values.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-Values-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-Values-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/wp-usermeta-Values-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;60px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"598\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/User-Role-Values.jpg\" class=\"attachment-full size-full\" alt=\"User Role Values\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/User-Role-Values.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/User-Role-Values-300x185.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/User-Role-Values-768x474.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/User-Role-Values-620x383.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]If you followed all the steps correctly, the success message should follow shortly.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-4.jpg\" class=\"attachment-full size-full\" alt=\"Success Message\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-4.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-4-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-4-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/01\/Success-Message-4-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]All the remaining user roles are assigned similarly, by using the appropriate <em>wp_capatibilites<\/em> and <em>wp_user_role<\/em> values given above.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Final Thoughts<\/h2>\n<p>[\/vc_column_text][vc_column_text]Knowing how to create a WordPress user with phpMyAdmin is a handy skill. It\u2019s especially valuable when you are unable to create users within your dashboard or if you need to recover your account but the usual methods have failed you. Even though this knowledge is most valuable when it comes to creating users with admin privileges, it can also serve with creating users with different user roles. So, to use phpMyAdmin to add a user, all you need to do is follow this article and you\u2019ll be done in a matter of minutes.<br \/>\n[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Learn how to use phpMyAdmin to add a user to your WordPress database and avoid being unable to log into your site ever again!<\/p>\n","protected":false},"author":11229,"featured_media":19173,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[49,50,4,13],"class_list":["post-19069","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-database","tag-sql","tag-tips","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/19069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/11229"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=19069"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/19069\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/19173"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=19069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=19069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=19069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}