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

Change MYSQL_* to MARIADB_* #122

Open
iuriguilherme opened this issue Jul 28, 2024 · 1 comment
Open

Change MYSQL_* to MARIADB_* #122

iuriguilherme opened this issue Jul 28, 2024 · 1 comment

Comments

@iuriguilherme
Copy link

latest mariadb uses environment variables like MARIADB_USER MARIADB_PASSWORD MARIADB_DATABASE instead of the MYSQL prefix.

Docker compose doesn't override multiple env files when using the form MYSQL_USER: ${MARIADB_USER}

So I have to update the same value twice when sharing the env_file with the mariadb container:

MARIADB_USER: user
MYSQL_USER: user
@fradelg
Copy link
Owner

fradelg commented Jul 29, 2024

I think docker-compose support loading environment variables from a .env file and then use them in your docker-compose:

https://stackoverflow.com/questions/29377853/how-can-i-use-environment-variables-in-docker-compose

# .env file
MARIADB_USER: user
version: "2"
services:
  mariadb:
  ...
  environment:
    MARIADB_USER: ${MARIADB_USER}
...
  mysql-cron-backup:
  ...
  environment:
    MYSQL_USER: ${MARIADB_USER}

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

2 participants