Contents
- 1 Add or Change User's Email Address
- 1.1 Log In to MariaDB
- 1.2 Switch to the Correct Database
- 1.3 Get Entire List of Users
- 1.4 Find User by Email Address
- 1.5 Find User by Username
- 1.6 Change Email Adress for User
- 1.7 If user_email_authenticated for that user is NULL but user_registration is Not
- 1.8 Check That Everything Got Changed
- 1.9 Exit MariaDB
Add or Change User's Email Address
Find name of database and other settings in "/var/www/mediawiki-1.23.0/LocalSettings.php"
$wgSitename = "XastirWiki"; $wgDBname = ""; $wgDBuser = ""; $wgDBpassword = "";
Note: Mariadb is running as user "mysql" on the system.
Log In to MariaDB
$ mysql -u WIKI-DB-USER -p # Use $wgDBname above. It'll ask for the database password
Switch to the Correct Database
> use NAME-OF-DB; # Use $wgDBname above
Get Entire List of Users
> SELECT Cast(user_name AS CHAR), Cast(User_Email AS CHAR) FROM user;
Find User by Email Address
> SELECT user_name FROM user WHERE user_email = 'user@example.com';
Find User by Username
> SELECT Cast(user_name AS CHAR), Cast(User_Email AS CHAR), user_registration, user_email_authenticated FROM user where user_name = 'USERNAME';
Change Email Adress for User
> UPDATE user SET user_email='user@example.com' WHERE user_name = 'USERNAME';
If user_email_authenticated for that user is NULL but user_registration is Not
> UPDATE user SET user_email_authenticated=user_registration WHERE user_name = 'USERNAME';
Check That Everything Got Changed
> SELECT Cast(user_name AS CHAR), Cast(User_Email AS CHAR) user_registration, user_email_authenticated FROM user where user_name = 'USERNAME';
Exit MariaDB
quit;