A user on my MediaWiki site would like to change their username. Is that possible, or better yet, possible and not too hard?
I'm guessing that the value in the user.user_name column for the user would have to be changed, and also the title of User page name. Hopefully any other references use the userid? Would pages have to be rebuilt?
Any info is appreciated.
Thanks, Matias
Matias Pelenur wrote:
A user on my MediaWiki site would like to change their username. Is that possible, or better yet, possible and not too hard?
I'm guessing that the value in the user.user_name column for the user would have to be changed, and also the title of User page name. Hopefully any other references use the userid? Would pages have to be rebuilt?
There's a helper script for this in the maintenance directory: changeuser.sql.
Set the oldname and newname variables at the top to the old and new names (use spaces, not underscores!) and run it through the mysql command-line client or phpmyadmin or whatever you've got to run SQL scripts into.
It's a little ugly, but it works (has been used on Wikipedia a number of times.)
I'd recommend backing up your database before running any manual scripts in case you make a mistake; SQL can be unforgiving!
-- brion vibber (brion @ pobox.com)
Related to the below - How do I delete a user?...
Thanks, Richard.
On Wed, 2004-07-07 at 12:13, Brion Vibber wrote:
Matias Pelenur wrote:
A user on my MediaWiki site would like to change their username. Is that possible, or better yet, possible and not too hard?
I'm guessing that the value in the user.user_name column for the user would have to be changed, and also the title of User page name. Hopefully any other references use the userid? Would pages have to be rebuilt?
There's a helper script for this in the maintenance directory: changeuser.sql.
<cut>
Richard Ames wrote:
Related to the below - How do I delete a user?...
Depends on just what you need.
If you just need to _lock out_ an account so it can't be used, you can clear the user_password, user_new_password and user_email fields (to prevent a new password from being requested by e-mail):
UPDATE user SET user_password='', user_newpassword='', user_email='' WHERE user_name='Some darn user' LIMIT 1;
I'd recommend against simply deleting the record, as this would allow anyone to create a new account with the same name, which you probably don't want as it would be mighty confusing.
If you want to remove the account's edit attributions, you could modify the change user script to insert "(Deleted user)" or something in place of their name. (This won't touch signatures or other literal text placed in pages that uses the name.)
-- brion vibber (brion @ pobox.com)
mediawiki-l@lists.wikimedia.org