Injecting a user into a WordPress mySQL database directly.

If you can read this then you can figure it out, be sure to match the wp_ prefix to match your database on all fields. Default installs will use wp_ but if you customize it then you’ll need to change it.

This is all assuming you have mySQL access to the database. This adds the user as a full administrator into the site (user_level = 10).

INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (‘2’, ‘loginname’, MD5(‘yourpasswordhere’), ‘Username’, ’[email protected]’, ‘http://www.website.com’, ‘2011-06-07 00:00:00’, ”, ‘0’, ‘Displayname’);

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

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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© Sorean's Virtual Home 2026. Theme: Architrave

Leave a comment
Expand sidebar⌘BCollapse sidebar⌘B
Focus modeExit focus mode