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

use defaults-extra-file instead of defaults-file #4334

Closed
wants to merge 1 commit into from

Conversation

ofrzeta
Copy link

@ofrzeta ofrzeta commented Feb 25, 2020

use defaults-extra-file for creds instead of defaults-file so mysqldump still reads the global defaults for setting stuff like "set-gtid-purged=OFF"

@greg-1-anderson
Copy link
Member

Seems okay to me. The only question I have is, what version of mysql was this option first supported? Do we risk breaking old mysql versions? If so, do we care? I found this exists in mysql 5.6, 5.7 and 8.0. It looks like Drupal 8 still supports mysql 5.5, so that implies Drush does too. Not sure if this option is available there.

If that's not an issue, then this is an improvement.

@greg-1-anderson greg-1-anderson removed their request for review March 5, 2020 01:48
@ofrzeta
Copy link
Author

ofrzeta commented Mar 5, 2020

Thanks for the review. Looks like MySQL 5.5 has the option: http://download.nust.na/pub6/mysql/doc/refman/5.5/en/option-files.html (also found some references to it in the docu of 5.1).

@weitzman
Copy link
Member

weitzman commented Mar 18, 2020

Seems reasonable to me as well but someone's setup always breaks when we change mysql config stuff like this. Mulling it.

@ofrzeta
Copy link
Author

ofrzeta commented May 15, 2020

Any progress on this?

@greg-1-anderson
Copy link
Member

If we're concerned about unlikely edge cases causing a problem, perhaps we could introduce a Drush configuration option to revert to the old directive.

@weitzman
Copy link
Member

I did some research. We started out with --defaults-extra-file as proposed in this PR. See #365. It got changed to --defaults-file in #2387. Given the history, I'm uninclined to change it back. Maybe we could make this a config pref.

@greg-1-anderson
Copy link
Member

OK the history from #2387 is that some users put sql credentials in their my.cnf file. If we go back to using --defaults-extra-file, then Drush breaks for all of those users, because credentials from the my.cnf file take precedence over credentials provided in --defaults-extra-file.

As disappointing as this is, I think it is unavoidable that we close this PR and look for another solution.

@weitzman
Copy link
Member

weitzman commented Jul 11, 2020

Seems like drush sql:dump --extra-dump="--set-gtid-purged=OFF" would fix this, right? This option can be added to a site's drush config if the typing gets error-prone or tedious.

@weitzman
Copy link
Member

This approach wont work. Lets continue in #4410

@weitzman weitzman closed this Jul 11, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants