From XastirWiki
Jump to: navigation, search

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;