# 手册:维护脚本

This page is a translated version of the page Manual:Maintenance scripts and the translation is 50% complete.
Other languages:
Deutsch • ‎English • ‎dansk • ‎español • ‎français • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎čeština • ‎русский • ‎हिन्दी • ‎中文 • ‎日本語 • ‎한국어
 用户 系统管理员 开发员 Translators

There are dozens of scripts with varying degrees of general utility and quality. You should carefully read the documentation on a script before using it; if a script isn't documented, take additional care running it.

## 配置

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. 如果未配置，它会使用手册:$wgDBuser配置的用户。

### MySQL

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



• 步骤6：执行需要运行的维护脚本
$php rebuildall.php  如果发生错误（例如：“php.exe is no valid Win32 application”）可以尝试下面的措施： $ php-cgi rebuildall.php




### 无shell访问权

On many shared hosts, you won't have shell access. The following extensions may be useful to run maintenance scripts via the web: Maintenance and MaintenanceShell.