I’ve been working with MySQL for several years, but now I’m in charge of a server and the paranoia surrounds me. I was writing a simple backup script for cron, and all was beautiful and clean…until I reached <mysqldump>. I had to write my password on the command line, and that’ no good my friend. But, as always happens, someone has thinking about that problem before, and in this case all you have to do is to write a little file named “.my.cnf”, place it in your home (or root’s home) and add this two lines:
There it is. Now you can sleep…
PD: after working with mysql from your account, delete “.mysql_history”, cause ALL you type in the MySQL CLI appears here…passwords, INSERTS…all clear with your “PASSWORD(###)” commands perfectly readable.