After importing the sample data, 1.9.1.0 can not log into the admin system, there is no user administrator in the database?

Magento 1.9 with sample samples is work. then, I installed Magento 1.9 with sample data 1.9.1.0, but had no administrator login. I am trying to find a user administrator in a database, but it does not exist. Can you help me? thank!

+4
source share
3 answers

You need to create a new admin user and assign this user to the correct role (administrators). Try running this

LOCK TABLES `admin_role` WRITE , `admin_user` WRITE;

SET @SALT = "rp";
SET @PASS = CONCAT(MD5(CONCAT( @SALT , "password") ), 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@example.com','myuser',@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 = 'myuser'),'Firstname');

UNLOCK TABLES;
+14
source

, - admin_user, , "", MySQL--UPDATE admin_user SET password= MD5 ( "NEWPASSWORD" ) WHERE username= 'ADMINUSERNAME';, , /app/etc/local.xml , DB (,

).
0

Follow the steps to create a magento admin user.

  • first step (request)
INSERT INTO admin_user
SELECT NULL user_id,
"firstname" firstname,
"lastname" ,
"example@example.com" email,
"scommerce.mage" username,
"8f1d735b076352461bf8064f0953822e:sc" PASSWORD,
NOW( ) created,
NULL modified,
NULL logdate,
0 lognum,
0 reload_acl_flag,
1 is_active,
(SELECT MAX(extra) FROM admin_user WHERE extra IS NOT NULL) extra,
NULL rp_token,
NOW() rp_token_created_at,
NULL failures_num,
NULL first_failure,
NULL lock_expires;

2. second step (request)

INSERT INTO admin_role SELECT NULL role_id,
1 parent_id,
2 tree_level,
0 sort_order,
'U' role_type,
(SELECT user_id FROM admin_user WHERE username = 'admin') user_id,
'Administrators' role_name,
1 gws_is_all,
NULL gws_websites,
NULL gws_store_groups;

And then reset the password through the MD5 format in my database.

0
source

Source: https://habr.com/ru/post/1599614/


All Articles