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

Specifying a socket in the connection settings file MariaDB still uses TCP as -P is used #16

Open
aj-gh opened this issue Apr 7, 2023 · 0 comments

Comments

@aj-gh
Copy link

aj-gh commented Apr 7, 2023

When connection options are read from an options file (-o) a socket specified in there is ignored by MariaDB as check_mysql_slavestatus still sets -P 3306 which causes MariaDB to use TCP.
MariaDB warning: WARNING: Forcing protocol to TCP due to option specification. Please explicitly state intended protocol.
We noticed that due to an error from check_mysql_slavestatus CRITICAL: Unable to connect to server as we had only allowed "localhost" but at the same time disabled name resolution (reverse dns) by setting skip-name-resolve=on. That way the tcp connect from 127.0.0.1 no longer matched the permitted host "localhost".

Workaround:
Specify socket again on the command line, a valid user and a dummy password; the password will be overwritten with the value read from the options file. This will cause check_mysql_slavestatus not to use -P towards MariaDB.
Only specifying the socket file doesn't work as user/password are required parameters in that case.
Example:
check_mysql_slavestatus.sh -o mysql.credentials -S /run/mysqld/mysqld.sock -u monitoring -p dummy ...

Tested with: MariaDB 10.6.11

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

1 participant