As Federico Sierra points out in the comments, you can use
mysqladmin password command to change the password for any user you can log in as.
Formerly the password had to be supplied on the command line, but as of 5.7, if the password is omitted it prompts for one.
From the mysqladmin documentation:
Set a new password. This changes the password to new_password for the account that you use with
mysqladmin for connecting to the server. Thus, the next time you invoke
mysqladmin (or any other client program) using the same account, you will need to specify the new password.
In MySQL 5.7, the new password can be omitted following the
password command. In this case,
mysqladmin prompts for the password value, which enables you to avoid specifying the password on the command line. Omitting the password value should be done only if password is the final command on the
mysqladmin command line. Otherwise, the next argument is taken as the password.
So, if you can log in as the user (i.e. you know a user's password - and you are on a host you are permitted to log in from) - then you can change their password with:
mysqladmin password -u <user_name> [-p]
$ mysqladmin password -u dave -p
Confirm new password:
If course, if you have root privileges, you can reset the user's password (and change their host if necessary) to enable you to log in to do this. But that comes with its own risks, so it's not ideal.