It can be a very difficult situation if your original WordPress administrator account is compromised or you are not able to access the WordPress dashboard to create a new admin user account. We thought of coming up with an article which can help our clients and users in general if they find themselves in similar situation.
In this article, we will cover a detailed step by step guide for you on how to create an admin user to the WordPress Database via cPanel using phpMyAdmin.
Note: Please take a backup of your database before making any MySQL edits. This tutorial would require you to have a basic understanding of how phpMyAdmin works.
Login to your cPanel account and access phpMyAdmin and locate your WordPress database. (Below is a screenshot taken from a Bluehost cPanel)
![bluehost-wordpress-hosting-cpanel](https://paramounttechnetwork.com/wp-content/uploads/2017/05/bluehost-wordpress-hosting-cpanel.png)
Select the correct database from a list of available databases in your phpMyAdmin from the left side menu.
![](https://paramounttechnetwork.com/wp-content/uploads/2022/04/wordpress-hosting-phpmyadmin.png)
Once you have selected the correct database, look for users and usermeta tables. Go ahead and click on users table. This table might be called wp_users in your menu.
![hosting-phpmyadmin-wp-user-table](https://paramounttechnetwork.com/wp-content/uploads/2017/05/hosting-phpmyadmin-wp-user-table-1024x492.png)
Select Insert from the top menu, as highlighted in the above screenshot. We will need to add our new admin user’s information. In the insert form, add the following.
- ID – Pick a number which isn’t already used by another user (in our example, we will use the number 7).
- user_login – add the username you want to use for accessing the WordPress dashboard.
- user_pass – pick a password for this username. Make sure you select MD5 in the functions menu (Please refer to the screenshot below).
- user_nicename – add a nickname for user.
- user_email – add the email address you want to associate with this user account.
- user_url – this would be the url of your website.
- user_registered – pick the date and time when this user will be registered.
- user_status – set this to 0.
- display_name – use the name you would like to display for this user (you can use your user_nicename value as well).
- On the right, click on the Go Button
![creating-new-admin-user-for-wordpress](https://paramounttechnetwork.com/wp-content/uploads/2022/04/creating-new-admin-user-for-wordpress.png)
Now, we are going to add the values to usersmeta table. From the left-side menu, select usermeta table. This table might be called wp_usermeta in your menu. From the top menu, select Insert.
![](https://paramounttechnetwork.com/wp-content/uploads/2022/04/wp-users-meta-table-for-setting-up-new-admin-user-1024x414.png)
- unmeta_id – You can leave it blank (it will be auto-generated)
- user_id – This will be the user id we created in the previous step. Remember we picked 7.
- meta_key – Enter wp_capabilities
- meta_value – Add:
a:1:{s:13:"administrator";s:1:"1";}
- Select Go.
![setting-wp-capabilities-for-admin-user](https://paramounttechnetwork.com/wp-content/uploads/2022/04/setting-wp-capabilities-for-admin-user.png)
Select Insert tab again and under Value column, add the following information:
- unmeta_id – leave this blank (it will be auto-generated)
- user_id – This will be the user id we created in the previous step. Remember we picked 7.
- meta_key – Enter wp_user_level
- meta_value – 10
- Select Go.
![saving-admin-user-from-cpanel](https://paramounttechnetwork.com/wp-content/uploads/2017/05/saving-admin-user-from-cpanel.png)
That’s it. You have created yourself a new username. You can now sign in to WordPress with your new username and password.