Menü schliessen
Created: December 3rd 2015
Last updated: May 1st 2020
Categories: Wordpress
Author: Marcus Fleuti

Wordpress :: create a new admin user manually directly in the database with PHPMyAdmin

Tags:  Admin,  MySQL,  PHPMyAdmin,  wordpress
Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

How to create a WordPress admin user manually by adding it directly on the database

The following MySQL commands will create a user called wpNewAdmin with the password 123456.

  1.  Login to PHPMyAdmin (or any other MySQL administration tool):
  2. Enter the following commands (change wpNewAdmin with your desired name)
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES ('newadmin', MD5('123456'), 'wpNewAdmin', 'wpNewAdmin@wpNewAdminMail.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');

google-apps-admin-panel-icon