GICT knowledge base
Create New Admin Account in WordPress via MySQL
Published
In this tutorial, we can discuss how to create a new admin account in WordPress via MySQL.
1) Login to your cPanel account.
2) Select the icon ‘phpMyAdmin’ under the ‘Databases’ section.
3) A new window will open and here you can see the list of databases of your accounts on the left-hand side bar. Then click on the database for your particular WordPress installation.
4) After the database details are loaded, you need to click on the tab ‘SQL’.
5) After clicking on SQL, a SQL editor will appear. Add the following code to the SQL editor. Here the code creates a new admin account named ‘newadmin’ with the password ‘admin123’. You may change any of the content to fit 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) Then click on the button ‘Go’.
This should simply refresh the screen and you should see the message ‘1 row affected’ after each of the three SQL statements. This means the insertion ran smoothly. From here, visit your WordPress admin login and use the new admin login information. You should see admin interface without any issue.
If you need any further help please contact our support department.
Related guides
7 Common Hosting Mistakes Beginners Make (And How to Avoid Them)
7 common hosting mistakes beginners make in 2026: no backups, ignored updates, bad host choice, weak passwords, single point of failure, no staging. With fixes for each.
WordPressWebsite Migration Backup Checklist: What to Save and How to Test
Prepare a website migration backup: inventory files, databases, email and DNS, check archive integrity, test recovery and plan a safe final synchronization.
WordPressCore Web Vitals in 2026: A Practical Fix Guide for Site Owners
Core Web Vitals 2026: practical fixes for LCP, INP, and CLS. Real root causes, what to measure, common misconceptions, and a priority order of fixes for site owners.
WordPressFixing the WordPress “Death Loop”: When Missing Files slow down your site
You’ve just launched your new WordPress site or pushed a big update. In your staging environment, everything ran perfectly.




