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.
  2. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  3. In the DATABASE section of the cPanel home screen, click phpMyAdmin:

  4. Select the WordPress site’s database from the list of databases on the and then, click on 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.

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

  6. 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.
  7. Click on the browse tab to view the newly created user:

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

  9. 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;}
  10. 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.

Usamos cookies con el fin de personalizar para usted nuestro sitio Web y analizar el uso de éste. Usted acepta esto haciendo clic en “Acepto” o al continuar usando el sitio Web. Hay más información sobre cookies en nuestra política de privacidad.