Skip to content

Instantly share code, notes, and snippets.

@rianrainey
Last active December 19, 2015 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rianrainey/5959919 to your computer and use it in GitHub Desktop.
Save rianrainey/5959919 to your computer and use it in GitHub Desktop.
Add an admin user to your Wordpress installation via MYSQL statements.
-- Create a new user into the db
INSERT INTO `wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_registered`, `user_activation_key`, `user_status`, `display_name`)
VALUES ('99', 'admin', MD5('admin'), 'Rian Rainey', 'rrainey@centresource.com', '2013-07-07 00:00:00', '', '0', 'Rian Rainey')
-- Give the new user administrator capabilities
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, '99', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}')
-- Give the new user the highest level in the system
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, '99', 'wp_user_level', '10')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment