Page MenuHomePhabricator

rebuildall uses wgDBuser (instead of wgDBadminuser), can fail with MySQL
Closed, ResolvedPublic

Description

Author: zacharyharris

Description:
If I set "$wgDBuser = $wgDBadminuser;" and "$wgDBpassword = $wgDBadminpassword;" (where wgDBadminuser has full database privileges), then rebuildall.php works just fine.

However, if I use a separate wgDBuser which has only SELECT, INSERT, UPDATE and DELETE permissions to the database (as described in http://www.mediawiki.org/wiki/LocalSettings.php#Security), then rebuildall.php fails as follows:

php maintenance/rebuildall.php --conf ./LocalSettings.php

  • Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):

Dropping index...
A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: ALTER TABLE searchindex DROP INDEX si_title, DROP INDEX si_text
Function: RebuildTextIndex::dropMysqlTextIndex
Error: 1142 ALTER command denied to user '[wgDBuser]'@'localhost' for table 'searchindex' ([MySQLhost])

It seems that if a command to ALTER the DB is required, then it should be using wgDBadminuser rather than wgDBuser.

MySQL 5.5.31


Version: 1.19.5
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz50025

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:52 AM
bzimport set Reference to bz50025.
bzimport added a subscriber: Unknown Object (MLST).

Related URL: https://gerrit.wikimedia.org/r/70371 (Gerrit Change Ifbd1d1d1d9c0d6f53ce13b92d94824beee67963f)

Related URL: https://gerrit.wikimedia.org/r/70371 (Gerrit Change Ifbd1d1d1d9c0d6f53ce13b92d94824beee67963f)

https://gerrit.wikimedia.org/r/70371 (Gerrit Change Ifbd1d1d1d9c0d6f53ce13b92d94824beee67963f) | change APPROVED and MERGED [by jenkins-bot]