Knowledge Base

How Can We Help?

Create New Admin Account in WordPress via MySQL

You are here:

In this tutorial, we will discuss the process of generating a brand new administrator account in WordPress through the utilization of MySQL.

1) Sign in to your cPanel account.

2) Select the ‘phpMyAdmin’ icon located under the ‘Databases’ section.

Admin Account

3) A new window will open and here you can observe the list of databases associated with your accounts on the left-hand side bar. Proceed to click on the database pertaining to your specific WordPress installation.

Admin Account

4) Once the database details have loaded, you will need to select the ‘SQL’ tab.

Admin Account

5) After clicking on SQL, an SQL editor will appear. Insert the following code into the SQL editor. The provided code will create a fresh admin account named ‘newadmin’ with the password ‘admin123’. You can modify any of the content according to your requirements.

INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`) VALUES (‘newadmin’, MD5(‘admin123’), ‘firstname lastname’, ’[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’);

6) Subsequently, click on the ‘Go’ button.

Admin Account

Simply refreshing the screen should result in the display of the message ‘1 row affected’ after each of the three SQL statements. This signifies the successful execution of the insertion. Proceed to access your WordPress administration login and utilize the newfound admin login details. You should be able to access the admin interface without encountering any issues.

If you require any further assistance, please do not hesitate to contact our support department.

Leave a Comment