How to manually add an admin user via phpMyAdmin Print

  • 0

How to Manually Add an Admin User via phpMyAdmin

If you are locked out of your WordPress dashboard, your "Lost your password?" emails aren't arriving, or you have a critical error preventing a standard login, you can create a new administrator account directly in your database.

This method bypasses the WordPress interface entirely and works even if the website is "broken" or showing a White Screen of Death.


Step 1: Access phpMyAdmin

  1. Log in to your Nixzoehost Client Area.

  2. Open cPanel and locate the Databases section.

  3. Click on phpMyAdmin.

  4. In the left-hand sidebar, click on your websites database name (usually formatted like username_wpXXX).


Step 2: Add the User to wp_users

We first need to create the basic user profile.

  1. Look for the table named wp_users (Note: your table prefix might be different, like nx_users). Click on it.

  2. Click the Insert tab at the top of the page.

  3. Fill in the following fields:

    • ID: Enter a high number that doesn't exist yet (e.g., 555).

    • user_login: The username you want to use (e.g., nixzoeadmin).

    • user_pass: Type your password, then in the Function column, select MD5 from the dropdown menu. (This is criticalit encrypts your password so WordPress can read it).

    • user_nicename: Your nickname.

    • user_email: Your email address.

    • user_registered: Select todays date/time.

    • user_status: Set to 0.

  4. Click Go at the bottom.


Step 3: Assign Admin Permissions in wp_usermeta

Now that the user exists, we must tell WordPress that this user is an Administrator.

  1. Find the table named wp_usermeta and click on it.

  2. Click the Insert tab.

  3. Fill in the first row (the Role):

    • unmeta_id: Leave blank.

    • user_id: Enter the ID you used in Step 2 (e.g., 555).

    • meta_key: Type wp_capabilities.

    • meta_value: Copy and paste this exact text: a:1:{s:13:"administrator";s:1:"1";}

  4. Fill in the second row (the Level):

    • unmeta_id: Leave blank.

    • user_id: Enter the same ID (e.g., 555).

    • meta_key: Type wp_user_level.

    • meta_value: Type 10.

  5. Click Go.


Step 4: Verify and Log In

  1. Navigate to yourdomain.com/wp-admin.

  2. Log in with the username and password you just created in phpMyAdmin.

  3. Success! You now have full access to your site again.


Why this is a "Power User" Feature

Standard Method phpMyAdmin Method
Relies on Email Bypasses Email entirely.
Requires Site to be "Up" Works even if site is crashed.
Admin Panel Access needed Direct Database access.
Slow Recovery Instant Access.

Nixzoehost Security Note: Once you have regained access and fixed your primary account, we recommend deleting the temporary admin user you created via phpMyAdmin for security. Alternatively, use the WordPress Management dashboard's "One-Click Login" to reset your password properly from within the site.


Was this answer helpful?

« Back