Updated: 22 October 2026 · Applies to: Wordpress, Joomla, Drupal, phpBB
1. Log in to your cPanel account from the top navigation menu. Select phpMyAdmin from the Databases section of the cPanel menu.2. Select your WordPress database from the list presented in the left sidebar.
3. In the right pane, click the SQL button.
4. Enter the following code in the box labeled Run SQL query/queries on the database. This code creates a new administrator account with the following credentials:
- Username: admin01
- Password: password01
5. Change these credentials in the code to your own selection.
INSERT INTO 'wp_users' ('user_login', 'user_pass', 'user_nicename', 'user_email',
'user_status')
VALUES ('admin01', MD5('password01'), 'firstname lastname', 'email@example.com', '0');
INSERT INTO 'wp_usermeta' ('umeta_id', 'user_id', 'meta_key', 'meta_value')
VALUES (NULL, (Select max(id) FROM wp_users),
'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO 'wp_usermeta' ('umeta_id', 'user_id', 'meta_key', 'meta_value')
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');
6. Click the Go button to run the query.
7. Now head to the WordPress administration dashboard and try to log in with the newly created credentials.
For any support, visit hire our experts.
Creating an admin account directly in the database like this bypasses WordPress's own password hashing checks, so always log in immediately afterward and change the password through the normal WordPress profile screen rather than leaving the manually-set one in place.
This method is meant as a last resort when the normal password-reset email is not an option, for example because the account’s own email address is no longer accessible either.