Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
To change a password I would use:
drush user-password USERNAME --password="SOMEPASSWORD"
Is there a similar way to change a user's name using Drush from the command line?
There isn't a built in Drush command, but you can use Drush's sql-query command (or sqlq shorthand) to update the user's name:
drush sql-query "update users set name='SOMENEWNAME' where uid=####"
Where #### is the user's uid and users is the user table.
Just an update for those looking for this for Drupal 8.6+. The query should be
drush sql-query "UPDATE users_field_data SET name='somenewname' WHERE uid=##";
Required, but never shown