How to add a WordPress Admin user through PhpMyAdmin/MySQL

I have recently had the issue where the the admin user I have created for a site maintained by the client was deleted so there was no way for me to do updates on the site.

In order to gain access, you can manually add a user provided that you have access to the CPanel so that you can do it in the PhpMyAdmin.

Please follow these steps:

#1. Login to your CPanel.

#2. Click on PhpMyAdmin under Databases.

#3. Click on the SQL tab.

#4. A page will open where there is a large textarea where you can write and execute MySQL codes. Use the code below in the textarea. This block of code will add the required information in the database for the new user.

Please take note that in the code, make sure to change the table prefix. For example, if your users table are using wptable_ as the prefix, update the values like wp_users from the code below to wptable_users. Also update the values that the table will contain such as myadmin, letmein, email@example.com.

#5 Click the GO button to execute the MySQL code.

#6 This should refresh the page and a notice that reads ‘1 row affected’ should appear above the textarea where you placed the code.

Share this Post

Comments 1

  1. So now that we have inserted our user we will need to give it privileges to access the WordPress Admin seciton. This is done through the wp_usermeta table. You will need to know the id of the user you just created. If you don t know the id now would be a good time to check the wp_users table for it. We will need to insert two rows into the wp_usermeta table, wp_capabilities and wp_user_level . Here are the steps you will need to follow to give your user privileges. . Interpult Studio – всегда эффективное продвижение

Leave a Reply

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