It is not possible to change --defaults-file with --defaults-extra-file. Although the two options seem to achieve the same result, there is a substantial difference.
When you use --defaults-file, the sandbox ignores any options file in the defaults locations:
/etc/my.cnf
/etc/mysql/my.cnf
$BASEDIR/my.cnf
If we use --defaults-extra-file, the above files are read before the given file. If they contain options that are not overwritten by the sandbox options file, strange things will happen.
When I designed the "my" script, I came across the inconsistent behavior when using multiple --defaults*-file options, and I decided that --defaults-file is the safest choice. I think this is more a bug in mysql tools than MySQL Sandbox.
Right now, if you add --defaults-extra-file to 'my', it passes it to the upstream tool:
./my sqldump --defaults-extra-file=./mysqldump.cnf --no-data mysql user
$HOME/opt/mysql/5.7.4/bin/mysqldump --defaults-file=$HOME/sandboxes/msb_5_7_4/my.sandbox.cnf --defaults-extra-file=./mysqldump.cnf --no-data mysql user
Here it is mysqldump that is not using the extra file.
I am open to suggestions that won't break the sandbox integrity
It is not possible to change --defaults-file with --defaults- extra-file. Although the two options seem to achieve the same result, there is a substantial difference.
When you use --defaults-file, the sandbox ignores any options file in the defaults locations:
/etc/my.cnf
/etc/mysql/my.cnf
$BASEDIR/my.cnf
If we use --defaults- extra-file, the above files are read before the given file. If they contain options that are not overwritten by the sandbox options file, strange things will happen.
When I designed the "my" script, I came across the inconsistent behavior when using multiple --defaults*-file options, and I decided that --defaults-file is the safest choice. I think this is more a bug in mysql tools than MySQL Sandbox.
Right now, if you add --defaults- extra-file to 'my', it passes it to the upstream tool:
./my sqldump --defaults- extra-file= ./mysqldump. cnf --no-data mysql user mysql/5. 7.4/bin/ mysqldump --defaults- file=$HOME/ sandboxes/ msb_5_7_ 4/my.sandbox. cnf --defaults- extra-file= ./mysqldump. cnf --no-data mysql user
$HOME/opt/
Here it is mysqldump that is not using the extra file.
I am open to suggestions that won't break the sandbox integrity