Access your WordPress database:
Log in to your hosting account or use a tool like phpMyAdmin to access your WordPress database.
Locate the wp_users table:
In the WordPress database, find the table named wp_users. The table prefix (wp_ by default) may vary depending on your WordPress installation.
Insert a new user:
Click on the “Insert” tab or the equivalent option in your database tool to insert a new record into the wp_users table. Fill in the following fields:
- ID: Leave this field blank or let it auto-increment.
- user_login: Enter the desired username for the new admin user.
- user_pass: Set a strong password for the new admin user. Choose the MD5 function (or another appropriate hashing function) for the
- Function dropdown menu, as WordPress uses hashed passwords.
- user_nicename: Enter a name or nickname for the user.
- user_email: Provide the email address associated with the new admin user.
- user_registered: Enter the registration date and time. You can use the current date and time.
- user_status: Set this field to 0.
- display_name: Enter the display name for the new admin user.
Save the new record:
Click on the “Go” or equivalent option to save the new record in the wp_users table.
Retrieve the user ID:
Locate the ID column in the wp_users table for the newly inserted user. Make a note of the corresponding value as you’ll need it in the next step.
Assign admin privileges:
Locate the wp_usermeta table in the WordPress database. Click on the “Insert” tab or equivalent option to insert a new record. Fill in the following fields:
- umeta_id: Leave this field blank or let it auto-increment.
- user_id: Enter the user ID you retrieved in step 5.
- meta_key: Enter wp_capabilities.
- meta_value: Enter a:1:{s:13:”administrator”;s:1:”1″;}. This assigns administrator privileges to the new user.
- Save the new record: Click on the “Go” or equivalent option to save the new record in the wp_usermeta table.
Once you complete these steps, you will have added a new WordPress admin user to your blog. You can now log in with the credentials you provided for the new user and access the WordPress dashboard as an administrator.