Tuesday, March 11, 2008

Manually Adding a User to a Group in Mediawiki

If you've locked yourself out of MediaWiki administration, say, by implementing LDAP authentication, this shows you how to add a user to MediaWiki groups by editing the security tables in the database. User rights are stored in a MySQL table called user_groups. Usually you'll find it's got the wiki prefix so to give a user with the user_id of 1 bureaucrat privileges in the system wiki, use the command:
insert into user_groups values(1,'bureaucrat');

The other 'power' group is sysop:

insert into user_groups values(1,'sysop');

To find out which user_id you want to use, execute the following:

select * from user
Note that you'll need to prefix the table names with a prefix, if you set up your wiki to use one.

No comments:

Post a Comment

Thanks for leaving a comment!