select u.id, u.user_name, u.active from cwd_user u join cwd_membership m on u.id=m.child_user_id join cwd_group g on m.parent_id=g.id join cwd_directory d on d.id=g.directory_id where g.group_name ='confluence-administrators'and d.directory_name='Confluence Internal Directory';
插入数据库管理员账号和密码 (用户名adm1n,密码admin),关注id是否重复。
1
insertinto cwd_user(id, user_name, lower_user_name, active, created_date, updated_date, first_name, lower_first_name, last_name, lower_last_name, display_name, lower_display_name, email_address, lower_email_address, directory_id, credential) values (1212121, 'adm1n', 'adm1n', 'T', '2009-11-26 17:42:08', '2009-11-26 17:42:08', 'A. D.', 'a. d.', 'Ministrator', 'ministrator', 'A. D. Ministrator', 'a. d. ministrator', 'admin@example.com', 'admin@example.com', (select id from cwd_directory where directory_name='Confluence Internal Directory'), 'x61Ey612Kl2gpFL56FT9weDnpSo4AV8j8+qx2AuTHdRyY036xxzTTrw10Wq3+4qQyB+XURPWx1ONxp3Y3pB37A==');
-- 插入confluence-administrators insertinto cwd_group(id, group_name, lower_group_name, active, local, created_date, updated_date, description, group_type, directory_id) values ( '888888','confluence-administrators','confluence-administrators','T','F','2011-03-21 12:20:29','2011-03-21 12:20:29',NULL,'GROUP',(select id from cwd_directory where directory_name='Confluence Internal Directory'));
-- 插入confluence-users insertinto cwd_group(id, group_name, lower_group_name, active, local, created_date, updated_date, description, group_type, directory_id) values ( '999999','confluence-users','confluence-users','T','F','2011-03-21 12:20:29','2011-03-21 12:20:29',NULL,'GROUP',(select id from cwd_directory where directory_name='Confluence Internal Directory'));
最后新增adm1n到管理组(与前面组id要一致)。
1 2 3 4
-- 1 insertinto cwd_membership (id, parent_id, child_user_id) values (888888, (select id from cwd_group where group_name='confluence-users'and directory_id=(select id from cwd_directory where directory_name='Confluence Internal Directory')), 1212121); -- 2 insertinto cwd_membership (id, parent_id, child_user_id) values (999999, (select id from cwd_group where group_name='confluence-administrators'and directory_id=(select id from cwd_directory where directory_name='Confluence Internal Directory')), 1212121);