Skip to content

Instantly share code, notes, and snippets.

@sewmyheadon
Created February 20, 2017 20:04
Show Gist options
  • Save sewmyheadon/709d6d6e7de0bef366481d64202fd5bf to your computer and use it in GitHub Desktop.
Save sewmyheadon/709d6d6e7de0bef366481d64202fd5bf to your computer and use it in GitHub Desktop.
Inject new Administrator user into WordPress database via SQL / phpMyAdmin
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES ('myusername', MD5('mypass321'), 'FirstName LastName', 'me@myemailaddress.com', '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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment