Manual:changePassword.php
From Linux Web Expert
<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.6
<translate> MediaWiki version:</translate> |
MediaWiki file: changePassword.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.41.1 • 1.40.3 • 1.39.7 |
Classes: | ChangePassword |
Details
changePassword.php file is a maintenance script to change the password of a user on your wiki. Note that passwords must have at least 10 characters.
Options/Arguments
Option | Description | Required? |
---|---|---|
--user | The username to operate on | <translate> Optional</translate> |
--userid | The user id to operate on | <translate> Optional</translate> |
--password | The password to use | <translate> Required</translate> |
Usage
php maintenance/changePassword.php [--user| --userid| --password ]
Terminal
$ php maintenance/changePassword.php --user Foo --password IamPassword Password set for Foo
Usernames and passwords can have spaces, which will need to be protected from your shell (be it bash or cmd.exe
; see Troubleshooting, below):
Terminal
$ php maintenance/changePassword.php --user "Foo Bar" --password "fierce sea ceasefire" Password set for Foo Bar
Troubleshooting
- If your MediaWiki installation uses a memory cache, such as APC, memcached or Redis, then the user object is cached. Thus after making SQL changes you must flush the cache before a user can log in with the new password.
- Windows has special challenges with parsing double-quoted strings, as when a username or password contains spaces in the second example above.
- Occasionally triple (
"""quoted string"""
) and quadruple sets of double quotes will solve your problems with Windows' command shell,cmd.exe
. You may be happier, though, to try Cygwin and follow the Unix conventions for quoting strings, which require fewer quotation marks.
- Occasionally triple (