How to Alter MySQL user password

The syntax to alter a user password is :

SET PASSWORD [FOR user] =
    {
        PASSWORD('cleartext password')
      | OLD_PASSWORD('cleartext password')
      | 'encrypted password'
    }
Example :
SET PASSWORD FOR 'user'@'ip addres' = PASSWORD('text password');
or
UPDATE mysql.user SET Password=PASSWORD('text password')
  WHERE User='user' AND Host='ip address';
FLUSH PRIVILEGES;
or it can be done like this as well by using the GRANT option
GRANT USAGE ON *.* TO 'user'@'ip address' IDENTIFIED BY 'text password';
Note:

Very important to know that SET PASSWORD may be recorded in server logs or in a history file such as ~/.mysql_history, which means that clear-text passwords may be read by anyone having read access to that information. So check the permissions on this file.