Add WordPress Admin user via MySQL query

By | January 24, 2014
Selec All Code:
1
2
3
4
5
6
// You may need TO UPDATE the TABLE names IF a Wordpress TABLE prefix has been SET.
 
INSERT INTO wp_users (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('spectrum', MD5('some-password'), 'Spectrum Computer Solutions', 'wordpress@spectrumcs.net', 'http://www.spectrumcs.net', NOW(), '', '0', 'Spectrum Computer Solutions');
SET @USER_ID = LAST_INSERT_ID();
INSERT INTO wp_usermeta (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, @USER_ID, 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO wp_usermeta (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, @USER_ID, '', '10');