Add WordPress Admin user via MySQL query

By | January 24, 2014
// 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');