手册:维护脚本/配置

This page is a translated version of the page Manual:Maintenance scripts/Configuration and the translation is 56% complete.
Other languages:


The $wgDBadminuser and $wgDBadminpassword configuration variables must be set in order to run maintenance scripts that need to alter the structure of the database (like 手册:update.php ) if the user configured in 手册:$wgDBuser doesn't have enough permissions. Alternatively, you can pass the --dbuser and --dbpass parameters to the script. The values for these variables differ based on the database engine that is being used to power your installation of MediaWiki. If not configured, it will use the user configured in 手册:$wgDBuser .

MySQL

某些维护脚本需要某些高级权限,这些权限出于安全原因,主MediaWiki数据库帐户并不具有。 如果尚不存在为MediaWiki数据库创建的“超级用户”(superuser)特权的单独数据库帐户,您应该创建一个这样的账户。 如果MediaWiki使用的数据库被称为wikidb,则以下SQL命令将创建一个可以在localhost上行使超级用户特权的账户:

GRANT ALL PRIVILEGES ON wikidb.* TO 'wikidbadmin'@'localhost' IDENTIFIED BY 'strong-password';

创建账户后,您应在$wgDBadminuser 中配置用户名。 变量$wgDBadminuser应该和一般配置变量一样存放在LocalSettings.php $wgDBadminuser的密码必须在$wgDBadminpassword 配置变量中设置。

PostgreSQL

PostgreSQL uses a different security model than MySQL and the same PostgreSQL server account used for day-to-day operation of the MediaWiki installation must also be used for running the maintenance scripts. This is necessary to ensure that the owner for new tables created by the maintenance scripts is set correctly. You don't need to set $wgDBadminuser or $wgDBadminpassword at all.