How to Create a New Admin Account in WordPress via MySQL
The following points undertake that your WordPress database table prefix is ready to “wp_”. If you’re working with one thing that is different table prefix, then change your code accordingly. As an example, if you’re using “wpsqltable_” instead of “wp_”, the code “INSERT INTO `wp_users`” gets change to “INSERT INTO ` wpsqltable_users`”.
Step 1: Log in to your cPanel account using login details.
Step 2: Locate the Databases section from the main cPanel interface, and then click on the icon entitled phpMyAdmin.
Step 3: Once the first screen appears, see at the left hand sidebar and click on the database for your explicit WordPress installation.
Step 4: When the database information get’s loaded, you can find the tab named as the SQL and click on it.
Step 5: Following is that the code to feature a new admin account within the SQL editor named newadmin with the password pass_abc. you’ll be able to change any of the content in red to fit your needs, however leave all other data as it is.
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES ('newadmin', MD5('password'), 'name', '[email protected]', '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');
Step 6: When substitution any data fields as per your need, click the Go button to execute the code.
Step 7: when the above step the screen is refresh and you’ll be able to see the message ‘1 row affected‘ after each of the three SQL statements. This suggests the query has run with success. From here, visit your WordPress admin login panel as common and utilize the new admin login information. you’ll be directed to admin interface with none hassle.