This repository was archived by the owner on Mar 24, 2026. It is now read-only.
Repository navigation
Fix permission issue when using skip-name-resolve, running a local MySQL database server and connecting via TCP - #6611
Merged
Conversation
… running a local MySQL database server and connecting via TCP.
Contributor
Author
|
Verified this against the ASP.NET Core MySQL tests. Looks good. |
Member
|
Fantastic! Thanks for doing this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the MySQL benchmarks can randomly fail when run in CI/GitHub Actions. This happens in CI, but not on Citrine.
The issue seems to be, that the CI runs the database server on the same machine/system as the benchmarks (client) themselves. This means, that the client host is the local machine, usually resolved as
localhost. But because we do not resolve client hostnames, because we use theskip-name-resolveoption in themy.cnfto avoid the performance overhead name resolution brings, the local IP address127.0.0.1might not get resolved tolocalhostat all.This only happens when using a local TCP connection, because MySQL seems to translate a Unix socket connection to
localhostimplicitly.The result would be an exception, that the (TCP) connection could not be established to the database server, even though it is up and locally running. For example, this happened randomly on the #6566 (comment) PR.
Typically for MySQL, you would setup users for
localhostand%(any host). For our CI usage here however, we need to explicitly add127.0.0.1as a hostname as well, so that non-resolved local TCP connections get mapped to a valid user account.(Also modernizes the
mysqldsetup code a bit and gracefully shuts it down during the docker image setup. While I am not entirely sure, whether the latter is strictly necessary or not, it is what the official MySQL docker files do.)