How to change a user password on MediaWiki

This took me forever to find and now I need a spot to keep this clip

These instructions are for MySQL.

Variables used:

* dbname
* User
* 37
* newpassword

Select database to use. First figure out the name of the appropiate database:

mysql> show databases;
+—————————————–+
| Database |
+—————————————–+
|dbname |
+—————————————–+
1 rows in set (0.00 sec)

mysql> Select database;

mysql> use dbname;

Database changed

Find the user_id for the user.

mysql> SELECT user_id, user_name from user WHERE user_name=”User”;

+———+—————+
| user_id | user_name |
+———+—————+
| 37 | User |
+———+—————+
1 row in set (0.00 sec)

Change the user’s pasword:

mysql> UPDATE user SET user_password = md5(CONCAT(’37-‘,md5(‘newpassword’))) WHERE user_id=37;

Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0

Advertisements