Reset a MediaWiki password

From low-art Gloominati

Jump to: navigation, search

For example, to change password for Sasha (user_id=4), we do the following:

root@datahost:/usr/home/mysql_backup# /usr/local/mysql/bin/mysql -u root -p -D wikidb
Enter password: *********
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2082 to server version: 5.0.27-max

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

mysql> select user_id,user_name,user_password from user;
+---------+--------------+----------------------------------+
| user_id | user_name    | user_password                    |
+---------+--------------+----------------------------------+
|       1 | WikiSysop    | 5a67142d2418e23d933890227bd631ae | 
|       2 | Frig.neutron | abaf31e1512c9d12831234be3ea008dd | 
|       3 | Val          | 6b706b1c6b74283fc913b37eab965895 | 
|       4 | Sasha        | 26c525a9d81f17c5732d4a9193dfed86 | 
|       5 | Void         | 100b67dc3ff8c783263b8887eef287d8 | 
|       6 | BYTE-Smasher | 892b2b0bff93fd7a8f5ee13e365f93a8 | 
|       7 | Turtle       | d3c3ee0a166a14767640dd697381e4b3 | 
|       8 | Yetiman      | fdb8641670484022019c37f7bd3e55ae | 
|       9 | Kai          | bfdcb3a9515c4e3fed0187651e9f0a3c | 
|      10 | Boris        | 0c24eb46a0f1a4cadaf2b1831cc464a5 | 
|      11 | Shmuser      | 12a299ba07981ee9eee6ccfedb3f6d45 | 
|      12 | Mike         | 693ee6d02e8b365153a1b83daefacffd | 
+---------+--------------+----------------------------------+
12 rows in set (0.00 sec)

mysql> update user set user_password=md5(CONCAT('4-',md5('NEW_PASSWORD'))) WHERE user_id=4;
Query OK, 1 row affected (0.03 sec)
Rows matched: 1  Changed: 1  Warnings: 0