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 (but not mysql) does not respect the MYSQL_UNIX_PORT env variable #2522

Open
jefft opened this issue Feb 17, 2025 · 0 comments
Open
Labels
bug Something isn't working triage Issue needs triage

Comments

@jefft
Copy link

jefft commented Feb 17, 2025

What happened?

To replicate:

cd /tmp
devbox create mariadbtest --template mariadb
cd mariadbtest
devbox run bash -c 'echo $MYSQL_UNIX_PORT'  # Prints /tmp/mariadbtest/.devbox/virtenv/mariadb/run/mysql.sock
# Note: do not start mariadb. This means we expect the connect attempt to fail
devbox run mariadb

The output ends with:

ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)

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:

cd /tmp
devbox create mysqltest --template mysql
cd mysqltest
devbox run bash -c 'echo $MYSQL_UNIX_PORT'  # Prints /tmp/mysqltest/.devbox/virtenv/mysql80/run/mysql.sock
# Note: do not start mysql. This means we expect the connect attempt to fail
devbox run mysql

This prints

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysqltest/.devbox/virtenv/mysql80/run/mysql.sock' (2)

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 and mariadb 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

@jefft jefft added bug Something isn't working triage Issue needs triage labels Feb 17, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs triage
Development

No branches or pull requests

1 participant