mysql-config-editor is the answer to manage mysql without displaying password on prompt or passing plain text files.
This tool mysql_config_editor will created encrypted .mylogin.cnf file, this will resolve the age old problem of reading cleartext password for the mysql scripts.
Command has the following options:
set [command options] Sets user name/password/host name/socket/port
for a given login path (section).
remove [command options] Remove a login path from the login file.
print [command options] Print all the options for a specified
reset [command options] Deletes the contents of the login file.
help Display this usage/help information.