How to Add an Admin User to the WordPress Database via MySQL

SQL query

For developers who want to speed this process up, you can simply drop this SQL query in your database.

Remember to change the databasename to the database you are working with. Also don’t forget to change the appropriate values.

USER : support
PASS : support


INSERT INTO `wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (’21’, ‘support’, MD5(‘support’), ‘Your Name’, ‘’, ‘’, ‘2011-06-07 00:00:00’, ”, ‘0’, ‘Your Name’);

INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ’21’, ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’);

INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ’21’, ‘wp_user_level’, ’10’);



Developer, Technology aficionado, Beer Lover and founder of Network. Who shares a keen interest about website development, health issues, cancer awareness and other fun stuff.

Add comment

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.

Most popular

Most discussed