Last active
November 21, 2017 17:39
-
-
Save rafalosinski/a901637712c8e58c0d843b826be88a74 to your computer and use it in GitHub Desktop.
Create WordPress Admin User from SQL (PHPMYADMIN)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @user_login='john_doe'; | |
SET @user_pass=MD5('YOUR_HARD_PASSWORD'); | |
SET @user_nicename=@user_login; | |
SET @user_email='john.doe@example.com'; | |
SET @user_url='http://example.com/'; | |
SET @display_name='John Doe'; | |
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 (null, @user_login, @user_pass, @user_nicename, @user_email, @user_url, CURRENT_TIMESTAMP(), '', '0', @display_name); | |
SET @last_id=LAST_INSERT_ID(); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, @last_id, 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, @last_id, 'wp_user_level', '10'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment