User:GPH/Rename user

From PaparazziUAV
Jump to: navigation, search

Few SQL code to rename a user:

SET @name = 'OldUsername';
SET @renameTo = 'DeletedUser';
UPDATE LOW_PRIORITY user SET user_name = 'NewUsername' WHERE user_name = 'OldUsername' ;
UPDATE LOW_PRIORITY user_newtalk SET user_ip = 'NewUsername' WHERE user_ip = 'OldUsername' ;
UPDATE LOW_PRIORITY cur SET cur_user_text = 'NewUsername' WHERE cur_user_text = 'OldUsername' ;
UPDATE LOW_PRIORITY old SET old_user_text = 'NewUsername' WHERE old_user_text = 'OldUsername' ;
UPDATE LOW_PRIORITY archive SET ar_user_text = 'NewUsername' WHERE ar_user_text = 'OldUsername' ;
UPDATE LOW_PRIORITY ipblocks SET ipb_address = 'NewUsername' WHERE ipb_address = 'OldUsername' ;
UPDATE LOW_PRIORITY image SET img_user_text = 'NewUsername' WHERE img_user_text = 'OldUsername' ;
UPDATE LOW_PRIORITY oldimage SET oi_user_text = 'NewUsername' WHERE oi_user_text = 'OldUsername' ;
UPDATE LOW_PRIORITY recentchanges SET rc_user_text = 'NewUsername' WHERE rc_user_text = 'OldUsername' ;