Manual:Resetting passwords/zh

在一些情况下，用户可能需要重置其密码. 例如，用户忘记了自己的密码，或是遇到某种可能会泄露其密码的安全漏洞. 大多数情况下，可以使用“通过邮件获得新密码”来重置密码.

对于忘记用户名或是无法查看邮箱的用户，可能需要管理员或系统管理员进行一些额外操作.

使用 Special:UserLogin
如果您知道自己账户的名称，则可以使用登陆界面上的“忘记密码”功能. 要使用此功能，请在维基上访问 Special:UserLogin 这个页面，填入用户名并点击“通过电邮发送新密码”按钮. 一个临时密码会发送到该用户名绑定的电子邮箱，一份重置密码的指导说明也会一同发送.

根据电邮地址寻找用户名
如果您指导一个用户的电邮地址，但不知道用户名，那么您可以通过在 MediaWiki 数据库中请求 表，来寻找关联的用户名. For example, to find the username for, run the following query:

Use the changePassword.php maintenance script
The maintenance script allows system administrators to change the password for an account. For complete instructions see. If you are already familiar with maintenance scripts, run the following command from  subdirectory:

Caution: System administrators should not know the unencrypted password for user accounts. A user may use the same password over many different sites. If one of their accounts that uses the same password is compromised, then suspicion can be thrown on the administrator. It is better to use "Email new password" to force the user to reset the password for their own account or to set a temporary password the user changes directly afterwards.

Use Special:PasswordReset
Special:PasswordReset allows accounts with the 'editmyprivateinfo' permission to reset account passwords for the local installation of MediaWiki.

To use:


 * Type username you want to reset in box provided and click "Reset password"
 * An automatically generated password will be emailed to the user

For automatically inserting the username in links, use.

Direct database modification
To reset a password you can change the value of the  field inside the   table in your database. However, it's generally far easier and safer to use "Email new password" or use the changePassword.php script. You should only use direct DB modification as a last resort, as its very easy to accidentally mess up your wiki. Always backup your database before doing any manual modification. The following only works when using MediaWiki's default authentication provider. If you are using an extension that modifies the authentication process (Like LDAPAuth), the following may not work.

The format you see in the user table will depend on  in. However if you use a different format, it will automatically be changed to the correct format the next time the user logs in. Thus for this guide, we show how to manually set the "B" format. This format is very easy to set from an SQL query. It is not the default format as it is weaker than pbkdf2, however that's ok as the user_password field will be upgraded to the correct format the next time the user logs in.


 * MySQL salted (1234 is the salt. You can replace it with any number as long as both places the number is used are the same):


 * PostgreSQL salted: