tags:

views:

37

answers:

2

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?

A: 

Why don't you just use one of the options and delete the relevant history file.

Noon Silk
Presumably the mysql history one, as that'd have less history at that point.
Andrew Grimm
+1  A: 

You can turn off MySQL history by setting

export MYSQL_HISTFILE=/dev/null

in your shell before starting mysql.

MySQL environment vars reference.

According to wikipedia the windows equivalent of /dev/null is \Device\Null or NUL.

martin clayton