Skip to content

Instantly share code, notes, and snippets.

@AlexWebLab
Last active April 24, 2017 06:06
Show Gist options
  • Save AlexWebLab/86e336012434cc01f87f17ed0f80b98f to your computer and use it in GitHub Desktop.
Save AlexWebLab/86e336012434cc01f87f17ed0f80b98f to your computer and use it in GitHub Desktop.
WordPress SQL administrator user creation
SET @user_login := 'admin_user';
SET @user_pass := 'Q9xiHgzZ';
SET @user_email := '[email protected]';
INSERT INTO `wp_users`
(`user_login`, `user_pass`, `user_email`, `user_registered`)
VALUES
(@user_login, MD5(@user_pass), @user_email, now());
SELECT @user_id := LAST_INSERT_ID();
INSERT INTO `wp_usermeta`
(`user_id`, `meta_key`, `meta_value`)
VALUES
(@user_id, 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
INSERT INTO `wp_usermeta`
(`user_id`, `meta_key`, `meta_value`)
VALUES
(@user_id, 'wp_user_level', '10’);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment