How to: Reset a MediaWiki password

From xoa

Jump to: navigation, search

Here's how to reset a password. In this example, I'm resetting User:Andy.

Log in to pigskin and run MySQL:

$ mysql -u root -p -D wikidb
Enter password: *****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3142 to server version: 5.0.27 

Type 'help;' or '\h' for help. Type '\c' to clear the buffer. 

mysql> 

Find Andy's ID:

mysql> select user_id, user_name from bogey_user where user_name='Andy';
+---------+-----------+
| user_id | user_name |
+---------+-----------+
|      10 | Andy      | 
+---------+-----------+
1 row in set (0.00 sec)

Reset the password using user_id value of "10", since that's Andy's ID. Note there are TWO places to set a "10" in this statement:

mysql> UPDATE bogey_user SET user_password = md5(CONCAT('10-',md5('newpassword'))) where user_id=10;
Query OK, 1 row affected (0.06 sec)
Rows matched: 1  Changed: 1  Warnings: 0

That's it. You're done.

Adapted from http://people.planetpostgresql.org/greg/index.php?/archives/74-Reset-a-user-password-on-MediaWiki.html

Personal tools