How to add an admin user to WordPress database from phpMyAdmin?

How to add an admin user to the WordPress database from phpMyAdmin?

  1. First, log in to cPanel using your account.
  1. Next, navigate to the Databases section. Here search for phpMyAdmin and click on it.
  2. You have multiple databases in your phpMyadmin. Choose your database among them.

Follow these steps to find the appropriate database name:

  • First, open the cPanel dashboard, then click on File Manager.
  • Next, go to the public_html folder and then click on wp.
  • On the right side of the webpage, you will get files and folders. There right-click on the wp-config.php file and click on the view option.
  • Here you will see the database name.

 

  • Now, go back to phpMyAdmin. In our case, the database table name is ‘aaravinfotech_wp576’. 
  • Find the databasename_users table, and click on it. 

 

  • Then, click on Insert.
  • Fill in all the required information in their respective fields.

 

  • Select MD5 in the user_pass dropdown.

 

  • Then, click on Go.
  • Click on the databasename_users table.
  • Here, you can see the recently added record with ID. We are going to use this id in the user_id field.
  • Next, select the databasename_usermeta table and click on Insert.
  • Enter the id of the user that you have created in the previous query.
  • Enter the databasename_capabilities in the meta_key text box. In our case, meta_key is ‘wplr_capabilities.’

 

  • Add this code: a:1:{s:13:”administrator”;s:1:”1″;} in the meta_value textbox.
  • Again, enter the user_id in this section.
  • Enter the databasename_user_level in the meta_key textbox. In our case, meta_key is ‘wplr_user_level’.

 

  • Enter the value as 10 in the meta_value textbox.
  • Next, click on Go.

Follow the steps given below to check the newly added admin user in WordPress:

  • First, log in to WordPress with a newly created username and password.
  • Then, click on Users.
  • The newly created username is in the Administrator role.

 

 

This is how you can add an admin user to the WordPress Database from phpMyAdmin.

 

Did you find this article useful?