MediaWiki how to reset a user password

Source: Internet
Author: User
Tags mediawiki

Today, get MediaWiki because a weekend still have a night not sleep cause forgot password (Welcome to the Groove ~)
began to toss the trip, originally thought you can directly execute a SQL statement will be done with the results ... According to most of the online

I can not find the original author, also may be translated official website document.
Reference
Forget the MediaWiki password, if the wiki-enabled email function ($wgEmailEnble =true), the user can get a new password by email, if not can use a more ruthless, the database administrator through the SQL statement directly modify the password field.

such as: UPDATE user SET User_password=md5 (CONCAT (' userid-', MD5 (' NewPassword '))) WHERE User_id=userid;

Attention:

If the table prefix is set at the time of installation, the table name in the modified statement is: Yourprefix_user
stored in the wiki is the password MD5 and Usrid in the MD5 once the results, in fact, in localsettong.php can also set whether to two times MD5
Of course, you can also use user_name in where, but remember to capitalize the first letter.

Depressed execution, write the change success, but still can't login that depressed AH ~

Keep checking, there's the following article.

You can use the maintenance/changepassword.php maintenance script to reset a user's password.

You must run the script under the command line. In other words, log on to the server where you installed the wiki, and then go to the command prompt. Go to the installation directory and enter the maintenance subdirectory. Run the following command:

PHP changepassword.php--user=someuser--password=somepass

The "Somepass" visible here is the password you are going to set, and "Someuser" is the user name whose password you will modify, which should appear in the "User" table of the database.

You can also use the old-fashioned way of directly modifying the database. Assuming that the variable $wgpasswordsalt has been set to the true value (default), you can run the following SQL query in MySQL:

UPDATE USER SET user_password = MD5 (CONCAT (user_id, '-'),
MD5 (' Somepass '))) WHERE user_name = ' someuser ';

The "Somepass" visible here is the password you are going to set, and "Someuser" is the user name whose password you will modify, which should appear in the "User" table of the database.

Note: The user_id in the concat string is a column name and should not be replaced with ' someuser '.

Note: If you get the ' Dbname.user table does not exist ' error, check the localsettings.php file and pay particular attention to the value of the $wgdbprefix variable. If the variable is not empty, try repeating the preceding command and replacing the user in the SQL query update clause with $wgdbprefix_user.

If you are using PostgreSQL, use the following query instead:

UPDATE mwuser SET User_password =
MD5 (user_id | | '-' | | MD5 (' Somepass ')) WHERE user_name= ' Someuser ';

You can also try using the Reset password plugin.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

MediaWiki how to reset a user password

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.