Created
May 19, 2016 04:01
-
-
Save mttjohnson/7ca23bf605c43f937094e3f3dac67659 to your computer and use it in GitHub Desktop.
create wordpress user from sql
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 := 'mjohnson'; | |
SET @user_pass := 'securePassword'; | |
SET @user_email := 'matt.johnson@classyllama.com'; | |
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