Add Administrator of WordPress through MySQL

If you can not login to your wordpress site using administrator account in conventional methos, then you may create another administrator account. To create another account you need to execute the following mysql commands:

INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`, `user_registered`) VALUES ('newadmin', MD5('pass123'), 'firstname lastname', '', '0', '2016-10-10 00:00:00');

INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');

INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');
, ,

2 responses to “Add Administrator of WordPress through MySQL”

  1. Awesome post, I would like to hide tags line on my blog I have ‘HIERO by aThemes’ installed on my blog. If you have any CSS code or other methods to hide the Post Tags which is showing in Homepage (after post) as well as inner post. Remember that I just want to hide Tags line not category (File Under). An earlier response will highly appreciated.

Leave a Reply

Your email address will not be published.