credentials file for running mysql related jobs via script?
It would be better to store the credentials in a config file, and load them as an extra-defaults file:

$ mysqldump --defaults-extra-file=mycred.cnf ...


The config file is the same format as /etc/my.cnf or ~/.my.cnf

$ cat mycred.cnf
[mysqldump]
user = myuser
password = xyzzy


MySQL 5.6 also introduces encrypted storage of credentials. You can set up an encrypted file ~/.mylogin.cnf:

$ mysql_config_editor set --login-path=dump --host=localhost --user=root --password
Enter password: 


Then you can dump using that login path

$ mysqldump --login-path=dump ...