HomeWordpress FixesCreate an Admin Account in WordPress via MySQL Query

Create an Admin Account in WordPress via MySQL Query

1.First login to control panel, goto phpmyadmin.

2.Look to the left hand sidebar and click on the database for your specific WordPress installation.

3.After the database information loads, you will need to find the tab named SQL and click on it.

4.This leads you to an SQL editor where you will enter some code that will create a new admin account for you. Below is the code to create a new admin account named admin100 with the password pass100.

INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES ('newadmin', MD5('pass123'), 'firstname lastname', 'email@example.com', '0');

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');

5. Click the Go button to perform the insertion.

New admin user will created with given username and password.

RELATED ARTICLES
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
- Advertisment -

Latest

How to whitelist website on AdBlocker?

0
Would love your thoughts, please comment.x
()
x