Add a WordPress admin user using PHPMyAdmin

  |   By  |  0 Comments

Just once in a while, you can’t get into the WordPress dashboard and you need to create a new admin user quickly. You can do it with PHPMyAdmin.

Login to PHPMyadmin

Goto your WordPress Database table and click on SQL.

Then copy and paste the MySQL statements below. Change YOUR USERNAME, PASSWORD, Your Username and EMAIL ADDRESS, before clicking Go.

Don’t make your username “admin”, unless you like getting hacked! That’s what attackers try first.

START TRANSACTION;
BEGIN;
SET @user_name="YOUR USERNAME"; # Put your chosen username in the quotes
SET @password ="PASSWORD"; #put your password in the quotes
SET @user_nicename = "Your Username"; #put your readable name in the quotes
SET @email = "EMAIL ADDRESS"; #put your email address in the quotes
INSERT INTO wp_users (`user_login`,`user_pass`,`user_nicename`,`user_email`,`user_status`,`display_name`,`user_registered`)VALUES(user_name,MD5(password),user_nicename,email,0,user_nicename,NOW());
INSERT INTO wp_usermeta(meta_key,meta_value,user_id)VALUES("wp_capabilities","a:1:{s:13:'administrator';b:1;}",LAST_INSERT_ID()),("wp_user_level",10,LAST_INSERT_ID());
COMMIT;
name

ABOUT THE AUTHOR - ANDY MOYLE

Andy Moyle is a church leader and web developer. His biggest project is the Church Admin WordPress plugin and app. He also runs, mainly so he can eat pizza.