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

mariadb v10 still needs -V #9

Open
TheDauthi opened this issue Dec 12, 2017 · 5 comments
Open

mariadb v10 still needs -V #9

TheDauthi opened this issue Dec 12, 2017 · 5 comments

Comments

@TheDauthi
Copy link

TheDauthi commented Dec 12, 2017

[EDIT: this posted before I was finished testing originally, feel free to delete until I test further to see if problem was elsewhere]

MariaDB v10 still uses the --ssl flag instead of --ssl-mode=REQUIRED, but nodot_ver for it returns a number greater than 56. This causes the wrong flag to be added if CONFIG_mysql_dump_usessl is true.

@BigAndini
Copy link
Contributor

Can you please provide the version string for MariaDB v10? Then I don't need to setup a complete server for that on my own. I think we need to have an additional variable to check whether we are on a mysql or a maria db server and the check for -ge 56 or -ge 10 or whatever mariadb version provides the encrypted login. I'll check that once I have the version string.

@TheDauthi
Copy link
Author

Certainly, the latest is 10.2.11. But you may also run into problems with other mysql-compliant clones (specifically, I'm not certain about Percona. There are other clients beyond that, but they're pretty rare).

You might consider checking to see if --ssl-mode is available as a variable instead of even worrying about version. If you call

mysql --ssl-mode=REQUIRED -V

mysql will attempt to set the ssl-mode variable in the client before printing the version. If it's not able to (ie, the variable doesn't exist), you will receive the error "unknown variable 'ssl-mode=REQUIRED'" and a false exit code. The -V will ensure that the mysql client doesn't attempt to do anything else. You could then use ssl-mode if it exists, and fall back to --ssl if it doesn't.

Note that the -V must occur after the flag you're testing. The command line parser parses until it sees the -V, and then stops.

Examples from a docker instance:
(MariaDB 10.2)
# mysql --ssl-mode=REQUIRED -V
mysql: unknown variable 'ssl-mode=REQUIRED'
# mysql --ssl=true -V
mysql Ver 15.1 Distrib 10.2.11-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

The real mysql client will act the same way, though at least of 5.6, ssl is still a valid variable. That doesn't change anything if you're using --ssl-mode as a progressive enhancement (the logic above; use ssl-mode if available and ssl if not). I'm just mentioning it so that you're not surprised by the behaviour during testing.

@SeLLeRoNe
Copy link

I was having this issue too, it shouldn't apply that if there is a "MariaDB" output on mysql -V command.

@BigAndini
Copy link
Contributor

So you get into this if you set the CONFIG_mysql_dump_encrypted_login to yes, but mariadb does not have an equivalent to the mysql_config_editor, which is needed to configure the credentials: https://mariadb.com/kb/en/library/mysql_config_editor-compatibility/

@SeLLeRoNe
Copy link

mmh I see, because with --ssl it was working fine I tought that was just a wrong parameter pass to the dump.
I will set it to know then, thanks :)

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

3 participants