Tutorials

WordPress :: Add Admin User using MySQL Command Line

:: How to add Admin User via MySQL Command Line
+ Login to mysql and select WordPress database

mysql -uroot -p
mysql>use db_wp;

+ Show tables value to check user id

mysql>select * from wp_users;

+ Add user admin level

mysql>insert into wp_users (ID,user_login,user_pass,user_nicename,user_email,user_url,user_registered,user_activation_key,user_status,display_name) values ('11','User Admin',MD5('AdminPassword','User Admin','[email protected]','','2012-01-08 00:00:00','','0','User Admin');

+ Add user to wp_usermeta

mysql>insert into wp_usermeta (umeta_id,user_id,meta_key,meta_value) values (NULL, '11', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
mysql>insert into wp_usermeta (umeta_id,user_id,meta_key,meta_value) values (NULL, '11','wp_user_level', '10');

+ Try login
open www.hostname.tld/wp-login.php and login using:

Username: User Admin
Password: AdminPassword

 
:: Links
+ Google
+ WPBeginner

Hi, I’m Sysadmin.ID

Leave a Reply

Your email address will not be published. Required fields are marked *