Skip to content

Instantly share code, notes, and snippets.

@rayflores
Last active August 29, 2015 14:04
Show Gist options
  • Save rayflores/101e4b25fa88a4cba035 to your computer and use it in GitHub Desktop.
Save rayflores/101e4b25fa88a4cba035 to your computer and use it in GitHub Desktop.
Create Admin User via database insert
<?php
INSERT INTO `wp_db_name_here`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('88', 'rayflores', MD5('cR@zYP@s5!'), 'rayflores', 'rayflores88@gmail.com', '', '2013-05-11 00:00:00', '', '0', 'Ray Flores');
// then do this one next
INSERT INTO `wp_db_name_here`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '88', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
// then do this one last
INSERT INTO `wp_db_name_here`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '88', 'wp_user_level', '10');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment