How to add WordPress admin account to database

If the prefix of the database is: wp_ then you can run the following queries:

# Create admin user
INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'my_adminusername', MD5('demo'), 'My Name', '', '', '2019-06-12 00:00:00', '', '0', 'My Name');

# Configure permissions
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10');
Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp