My ghost blog installed in our inner network(can not access internet), I need add new user, but the ghost need send email for new user.
I want use sql to add new user. It works.
insert into users (id,
uuid,
name,
slug,
password,
email,
image,
cover,
bio,
website,
location,
accessibility,
status,
language,
meta_title,
meta_description,
last_login,
created_at,
created_by,
updated_at,
updated_by)
values ('3',
'30443ade-312c-4842-aa3a-f6c0dcd056f7',
'zoyun',
'zoyun',
'$2a$10$X3GF9POpZi4Fpr5U1px0EuTEPo33JVVio54gwypP4iB9/BSVNUzfq',
'[email protected]',
NULL,
NULL,
NULL,
'',
'',
NULL,
'active',
'en_US',
NULL,
NULL,
'2014-10-18 17:12:40',
'2014-10-18 12:55:44',
'1',
'2014-10-18 17:12:40',
'1');
insert into roles_users (role_id, user_id) values ('1', '3');
But when I use new user to logon, the firebug console show error message: "There is no user with that email address."
Hey @hjzheng, welcome to Ghost!
I have tried your SQL statements with my own installation of Ghost and the user is found without a problem. This leads to the assumption that this is a environment issue? Maybe the wrong database?
I'll close this issue since we are using GitHub to track bugs and progress on features. I recommend dropping by our slack team or the forum if you have questions about environment issues :wink:.
I had same problem so this is what I did
insert into users (id,
name,
slug,
password,
email,
status,
visibility,
created_at,
created_by
)
values ('3',
'andrej',
'andrej',
'$hashedpassword-copy it from your main user and later change',
'[email protected]',
'active',
'public',
'2018-12-10 14:12:40',
'2018-12-10 13:55:44'
);
Then
select * from roles_users;
You will get 3 fields first one is id which can be any unique string, then role_id( i copied from ogirinal user) and id of newly inseerted user, which was 3
insert into roles_users (id,role_id,user_id) values('a','5c08fe42bdc6760cbbc2ec7f',3);
IT WORKS
Later you can change password from web app
I saw that this issue has been created on May 6, 2015.
This solution is still working with recent Ghost versions :-)
Tested and working fine on Ghost v3.5.2.
The query is working and you even can pass an empty string to password field, change by UI will work anyway. However if you'll try to update the user info you will get a validation error message without any useful details (at least in v3.12.1). To workaround this the id of the inserted user should match /^[a-f\d]{24}$|^1$|me/i pattern.
Most helpful comment
I had same problem so this is what I did
It will show all the neccessery fields by stating NULL to NO
For me those were the following
insert into users (id,
name,
slug,
password,
email,
status,
visibility,
created_at,
created_by
)
values ('3',
'andrej',
'andrej',
'$hashedpassword-copy it from your main user and later change',
'[email protected]',
'active',
'public',
'2018-12-10 14:12:40',
'2018-12-10 13:55:44'
);
Then
select * from roles_users;
You will get 3 fields first one is id which can be any unique string, then role_id( i copied from ogirinal user) and id of newly inseerted user, which was 3
insert into roles_users (id,role_id,user_id) values('a','5c08fe42bdc6760cbbc2ec7f',3);
IT WORKS
Later you can change password from web app