Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using --defaults-file ignores the .my.cnf #605

Open
dugwood opened this issue Aug 10, 2022 · 4 comments
Open

Using --defaults-file ignores the .my.cnf #605

dugwood opened this issue Aug 10, 2022 · 4 comments

Comments

@dugwood
Copy link

dugwood commented Aug 10, 2022

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.html

But 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!

@jmrenouard
Copy link
Collaborator

Hi,

Implementation could be adding defaults-extra-file in parameter list

Last commit 2.0.7 is a try for this feature

@jmrenouard
Copy link
Collaborator

Can you tell us about this --defaults-extra-file new option ?

@dugwood
Copy link
Author

dugwood commented Sep 13, 2022

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).

@dugwood
Copy link
Author

dugwood commented Sep 13, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants