After reading the answers on MYSQLDUMP without the password prompt I was wondering :
Is it possible to store multiple credentials, to different db accounts, in one
~/.my.cnf
file? If so, what is the syntax?
N.B.: I reckon that could rise security issues but that's strictly for local/dev environment.
Asking on IRC #mysql here is what I got:
MrAmmon | not really, no. You can, if you like, have multiple files and reference them, though MrAmmon | example - mysql --defaults-file=~/.my.cnf-bobby
--defaults-file=
must be the first option):mysqldump --defaults-file="$HOME/.my.project.cnf" -u projectUser --no-create-db --no-create-info projectDb
There is several argument to control options:
--no-defaults: Don't read default options from any option file. --defaults-file=#: Only read default options from the given file #. --defaults-extra-file=#: Read this file after the global files are read.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With