I\'ve recently had to dust off my Perl and shell script skills to help out some colleagues. The colleagues in question have been tasked with providing some reports from an inter
There is no good solution. You can obfuscate the passwords a bit, but you can't secure them.
If you have control over your DB setup, you could try to connect by a named pipe (at least mysql supports that) without a password and let the OS handle the permissions.
You could also store the credentials in a file with restrictive permissions.