Page MenuHomePhabricator

Have update.php check it has CREATE, DROP, ALTER before running
Open, Needs TriagePublic

Description

[split from T209285]
update.php (and web upgrader) Should check if the db user has the rights to do db maintenance (e.g. CREATE TABLE, DROP, ALTER etc). The normal db error message about running the upgrader is confusing in this context, so it makes sense to check this condition explicitly. Additionally, this would be a good time to inform the user about the possibility of using $wgDBadminuser / $wgDBadminpassword for people who don't want the normal db user to have these rights.

I'm unsure what the best approach is here, whether to explicitly catch permission errors (DBQueryError), or to check SHOW GRANTS at the beginning of includes/installer/MysqlUpdater.php (This would be mysql specific since other dbs probably have different permission systems).