WordPress :: Add Admin User using MySQL Command Line

35 sec read

:: 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

How to fix problem with…

Facing a Git error with the 'vi' editor? Discover how to easily fix it by checking your Vim path and configuring Git to use...
Sysadmin.ID
10 sec read

Apache :: MP4 Streaming

Learn how to enable MP4 streaming in Apache with the installation of the mod_h264 streaming module, making your video content accessible and efficient. Follow...
Sysadmin.ID
18 sec read

Apache :: Flash / FLV…

Learn how to effortlessly configure Apache for FLV streaming by installing the mod_flvx module and updating your httpd.conf file. Discover the simple steps to...
Sysadmin.ID
15 sec read

Leave a Reply

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