Add your user to SYSOP group MediaWiki via MySQL

The sysop are the wiki administrators, so only users in that group can perform administration task like delete a page. If for some reason you can not add your user to the SYSOP group with Special:UserRights you can use a mysql query to do that.

To access to the MySQL database, you can see the configuration file LocalSettings.php in the wiki root, the files contain the Database user and password in the ## Database settings section.

Promote user

  • Connect to MySQL client:
mysql -h localhost -u wikiuser -p wikidb  
  • Find your username:
SELECT user_id, CONVERT(user_name USING utf8) FROM `user`;  
  • Add the user to sysop and bureaucrat group:
SELECT user_id INTO @uid FROM user  
INSERT INTO `user_groups`(`ug_user`, `ug_group`)  
VALUES (@uid,'bureaucrat'),(@uid,'sysop');