Created
August 14, 2018 14:30
-
-
Save EricSeastrand/481c5c97085b9e625b142eab404723d1 to your computer and use it in GitHub Desktop.
Magento 1 Create Admin User DB queries
This file contains hidden or 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 @LOGIN_PW = "password_goes_here"; | |
SET @USERNAME = "username_goes_here"; | |
SET @FIRSTNAME = "Test"; | |
SET @LASTNAME = "Tester"; | |
SET @EMAIL = '[email protected]'; | |
SET @SALT = "rp"; | |
SET @PASS = CONCAT(MD5(CONCAT( @SALT , @LOGIN_PW) ), CONCAT(":", @SALT )); | |
SELECT @EXTRA := MAX(extra) FROM admin_user WHERE extra IS NOT NULL; | |
INSERT INTO `admin_user` (firstname,lastname,email,username,password,created,lognum,reload_acl_flag,is_active,extra,rp_token_created_at) | |
VALUES (@FIRSTNAME,@LASTNAME,@EMAIL,@USERNAME,@PASS,NOW(),0,0,1,@EXTRA,NOW()); | |
INSERT INTO `admin_role` (parent_id,tree_level,sort_order,role_type,user_id,role_name) | |
VALUES (1,2,0,'U',(SELECT user_id FROM admin_user WHERE username = @USERNAME),@FIRSTNAME); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment