-
Notifications
You must be signed in to change notification settings - Fork 230
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 (but not mysql) does not respect the MYSQL_UNIX_PORT env variable #2522
Comments
jefft
added a commit
to jefft/devbox
that referenced
this issue
Feb 18, 2025
devbox.json. Also for mariadb, specify --socket to work around jetify-com#2522.
jefft
added a commit
to jefft/devbox
that referenced
this issue
Feb 18, 2025
…NIX_PORT, since strangely, the native binaries do not (jetify-com#2522). Also specify the root user/password.
Lagoja
added a commit
that referenced
this issue
Mar 11, 2025
…ort path (#2523) ..rather than plugin's project-relative path, to avoid triggering 'The socket file path is too long (> 107)' error on start. Also specify the (blank) password in 'test_db_setup'. Fixes #2521 ## How was it tested? Per the description in #2521, after this change `mysqld` should come up in a >107 length path, e.g.: ``` cd ~/src/github.com/jetify-com/devbox/examples/databases/mysql devbox services up -b tail -1 .devbox/compose.log # This shows the socket path, which should now be /tmp/devbox/mariadb/run/mysql.sock devbox run mysql -u root -p # Blank password - connects ``` Note: I have patched mysql and mariadb because they are essentially the same. However whereas `mysql` respects the `MYSQL_UNIX_PORT` env variable, `mysql` from the mariadb package does not (logged as #2522), so the last step of this code fails: ``` cd ~/src/github.com/jetify-com/devbox/examples/databases/mariadb devbox services up -b tail -1 .devbox/compose.log # This shows the socket path, which should now be /tmp/devbox/mariadb/run/mysql.sock devbox run mysql -u root -p # ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2) ``` Aside from testing, this mariadb bug is irrelevant to this patch. I just thought I'd mention it. --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: John Lago <[email protected]> Co-authored-by: Artem Klevtsov <[email protected]> Co-authored-by: Greg Curtis <[email protected]> Co-authored-by: Daniel Loreto <[email protected]> Co-authored-by: Mike Landau <[email protected]> Co-authored-by: John Lago <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Will Brennan <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
To replicate:
The output ends with:
This shows that the socket path,
MYSQL_UNIX_PORT
, is not being read.To show that this is buggy, run the exact same steps with mysql instead of mariadb:
This prints
which is correct - the MYSQL_UNIX_PORT socket is being used.
Perhaps this is an upstream mariadb bug. A fix/workaround would be for Devbox's mariadb flake.nix to generate
mysql
andmariadb
wrappers that set--socket=$MYSQL_UNIX_PORT
.Steps to reproduce
No response
Command
No response
devbox.json
Devbox version
0.14.0
Nix version
nix (Nix) 2.18.5
What system does this bug occur on?
Linux (x86-64)
Debug logs
No response
The text was updated successfully, but these errors were encountered: