According to the MySQL Reference Manual, Section 5.5.6 [0] the only solution to securely pass a password to mysql seems to be either by entering it at the prompt (which is not an option here) or by specifiying it in a properly protected config file.
[0] http://dev.mysql.com/doc/refman/5.0/en/password-security.html
signature.asc
Description: Digital signature