I was looking for unix bash history to give * for mysql password.
Eg: If I issue –
mysql -uroot -psecuritydemon -h192.168.90.888
then in unix prompt if I use history | grep -i mysql -> I get the password entry too.. Instead I would like to see for the history grep result as below
mysql -uroot -p*** -h192.168.90.888
Any way to achieve this?
I don’t think it is possible to filter the command that is written to your history in bash. However, I would suggest you use a
~/.my.cnfconfiguration file as described here: http://support.modwest.com/content/6/242/en/how-do-i-create-a-mycnf-mysql-preference-file.html. And make sure you set the permissions to
go-rwxso that noone else can read your file.