How to create WordPress admin user in MySQL using phpMyAdmin

You can create a user in WordPress in two ways: through the WordPress admin dashboard or by directly creating a user on the database. If you have lost access to your administrator login, then this article will demonstrate how to create an admin user on a MySQL database using phpMyAdmin for WordPress.

Creating a WordPress admin user in MySQL using phpMyAdmin

To create a user on MySQL using phyMyAdmin, follow these steps:

  1. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  2. Open phpMyAdmin:
    • If you are using the Jupiter theme, on the Tools page, in the Databases section, click phpMyAdmin:

      cPanel - Databases - phpMyAdmin icon

    • If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click phpMyAdmin:


  3. Select the WordPress site’s database from the list of databases, and then click the wp_users table:

    Under hosting accounts the prefix of the wp_users table could be changed for security reasons. Open the table with [anyprefix]_users. For example wpem_users.

  4. On the wp_users table or prefix_users, click on the Insert tab, and then fill in the form:

  5. Fill in the user form with the following details, and then to save the details click the Go button:

    • user_login: Insert the username for your new admin user.
    • user_pass: Add a password for the account and select MD5 in the Function drop-down.
    • user_email: Add the email address for the user
    • user_registered: Select the date and time for when the user should be registered.
    • user_status: Set this value to zero.
  6. Click on the browse tab to view the newly created user:

  7. Click on the wp_usermeta or [prefix]_usermeta table, and then click the Insert tab:

  8. Fill in the following values (leave the other fields empty) and then click Go:

    • user_id: Fill in the ID of the user you created in the previous step (from the users table).
    • meta_key: Enter wp_capabilities or if your tables have a prefix then enter prefix_capabilities. Example : wpem_capabilities
    • meta_value: Fill in the field with a:1:{s:13:"administrator";s:1:"1";}. If your table name has a prefix then fill in the field with a:1:{s:13:"administrator";b:1;}
  9. Access WordPress admin login page, and login using the newly created user credentials.
Get Managed WordPress Hosting

Article Details

Other Articles in This Category

Show More

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.