Open dugwood opened 2 years ago
Hi,
Implementation could be adding defaults-extra-file in parameter list
Last commit 2.0.7 is a try for this feature
Can you tell us about this --defaults-extra-file new option ?
Thanks Jean-Marie,
The defaults-file
erase the default configuration (say my.cnf
) whereas defaults-extra-file
will add / replace previous options set by my.cnf
.
The idea is to load a master file (which may not be the my.cnf
), then provide a user credentials (which may not be the root
user).
My issue is that I've multiple MySQL instances on the same server (for development purposes), so I can't test anything else than the default server. Or I must set the credentials within the my.cnf
, which I don't think is a good idea.
Perhaps using [mysqladmin]
section is another good idea, but not being able to provide a specific user credentials is the may issue here (as --pass
is ignored if --defaults-file
is used).
Sorry, just saw your 2.0.7 release. There's an issue with it, as defaults-extra-file
isn't set instead of defaults-file
, but along with it.
So it should be set within the defaults-file
test: https://github.com/major/MySQLTuner-perl/blob/master/mysqltuner.pl#L906 (or duplicated in it).
I was trying to use
--defaults-file
(same server, multiple MySQL instances for staging purposes), but adding--defaults-file
prevent the--pass
or.my.cnf
reading.According to MySQL documentation, that makes sense as
defaults-file
is the only file read: https://dev.mysql.com/doc/refman/8.0/en/option-file-options.htmlBut it would be great to implement either
--defaults-extra-file
, allow--pass
to work, or allow using another file to read credentials (.mylogin.cnf
is read by MySQL as a default).Can you point me to the solution you'd rather implement, I could create a PR based on that choice?
Thanks!