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

(8.4) PXC-4558: mysql cannot connect to mysql-server in post-processing, if the host is not localhost in the .mylogin.cnf #1989

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

kamil-holubicki
Copy link
Contributor

https://perconadev.atlassian.net/browse/PXC-4558

Problem:
If .mylogin.cnf file is present and it contains 'host' specified which is
not localhost, the SST script is not able to connect to post-processing
(post-sst) mysqld instance and SST fails.

Cause:
SST script, on both sides, donor and joiner, uses socket protocol to
connect to the local mysqld instance (mysql, mysqladmin, pxb).
If .mylogin.cnf file is present and contains 'host' parameter, it takes
precedence over command line options, even if `--protocol=SOCKET' is
specified explicitly. On joiner side, after SST, so-called
post-processing mysqld instance is started. It has networking disabled,
the only way to connect is via socket. Having .mylogin.cnf file in place
causes mysql and mysqladmin to try TCP transport instead of the socket
and SST fails.

As donor instance has networking enabled, this issue unlikely to be
visible on that side. However, if .mylogin.cnf file is present and
contains 'host' and not correct 'port', the donor side will fail as well

Solution:
For SST environment (SST script), override .mylogin.cnf by exporting
MYSQL_TEST_LOGIN_FILE env variable.

if the host is not localhost in the .mylogin.cnf

https://perconadev.atlassian.net/browse/PXC-4558

Problem:
If .mylogin.cnf file is present and it contains 'host' specified which is
not localhost, the SST script is not able to connect to post-processing
(post-sst) mysqld instance and SST fails.

Cause:
SST script, on both sides, donor and joiner, uses socket protocol to
connect to the local mysqld instance (mysql, mysqladmin, pxb).
If .mylogin.cnf file is present and contains 'host' parameter, it takes
precedence over command line options, even if `--protocol=SOCKET' is
specified explicitly. On joiner side, after SST, so-called
post-processing mysqld instance is started. It has networking disabled,
the only way to connect is via socket. Having .mylogin.cnf file in place
causes mysql and mysqladmin to try TCP transport instead of the socket
and SST fails.

As donor instance has networking enabled, this issue unlikely to be
visible on that side. However, if .mylogin.cnf file is present and
contains 'host' and not correct 'port', the donor side will fail as well

Solution:
For SST environment (SST script), override .mylogin.cnf by exporting
MYSQL_TEST_LOGIN_FILE env variable.
@kamil-holubicki kamil-holubicki changed the title (8.4) PXC-4558: mysql cannot connect to mysql-server in post-processing, if the host is not localhost in the .mylogin.cnfPxc 4558 8.4 (8.4) PXC-4558: mysql cannot connect to mysql-server in post-processing, if the host is not localhost in the .mylogin.cnf Dec 17, 2024
@kamil-holubicki kamil-holubicki merged commit a6afd29 into percona:8.4 Dec 17, 2024
4 checks passed
kamil-holubicki added a commit to kamil-holubicki/percona-xtradb-cluster that referenced this pull request Feb 20, 2025
(8.4) PXC-4558: mysql cannot connect to mysql-server in post-processing, if the host is not localhost in the .mylogin.cnf

Cherry pick commit a6afd29
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.

2 participants