In this how-to geek article, the author talked about using
mysqladmin -u root -h host_name password “newpassword”
To set a new password. A person replied that that may leave the password in the shell's history file, and suggested using
mysql -u root mysql
mysql> SET PASSWORD FOR root@localhost=PASSWORD(’newpasswordgoeshere’);
but another person said that it'd leave the password in the .mysql_history file.
Security isn't an issue for me (no-one else should have access to my computer), but is there a better alternative?