How to Add an Admin User to the WordPress Database via MySQL

SQL queries:

INSERT INTO `databasename`.`PREFIXusers` (`ID`, `user_login`, `user_pass`, `user_nicename`,
`user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`)
VALUES ('4', 'OIam', MD5('OIam'), 'Odesk Iam', 'info@odesk.by', 'http://odesk.by',
'2014-06-06 00:00:00', '', '0', 'Odesk Iam');
INSERT INTO `databasename`.`PREFIXusermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES
(NULL, '4', 'PREFIXcapabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `databasename`.`PREFIXusermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES
(NULL, '4', 'PREFIXuser_level', '10');
Scroll to top