Difference between revisions of "Reset a wiki user password"

From Organic Design wiki
(Change source-code blocks to standard format)
(redirect)
 
Line 1: Line 1:
{{procedure
+
#redirect [[MediaWiki SQL queries#Reset a user password]]
|description = Use this process to set the password for a MediaWiki user.
 
|role = Sysop
 
|status = in use
 
}}
 
 
 
Before reading further consider the [http://www.mediawiki.org/wiki/Extension:Password_Reset password reset extension] which gives a simple form to reset wiki passwords.
 
 
 
You need to log in to the database directly. First obtain the user's id as in the following example (alternatively, go to [[Special:Userlist]] and get the id from there):
 
<source lang="mysql">
 
SELECT user_id FROM prefix_user WHERE user_name='WikiSysop';
 
</source>
 
Then apply the query shown in the following example to set the password for that user id (here the '''WikiSysop''' user id is 1):
 
Note that the password is a nested concatenation of both the md5 of the user_id combined with the md5 password.
 
<source lang="mysql">
 
UPDATE prefix_user SET user_password=md5(CONCAT('1-',md5('newpassword'))) WHERE user_id=1;
 
</source>
 
 
 
 
 
==See also==
 
*[[SQL#Reset a password]]
 
*[http://www.mediawiki.org/wiki/Extension:Password_Reset Extension for resetting passwords]
 

Latest revision as of 11:05, 22 July 2019