linuxserver / docker-mariadb

GNU General Public License v3.0
202 stars 42 forks source link

Documentation clarification - environment variables #143

Open chelming opened 1 month ago

chelming commented 1 month ago

Is this a new feature request?

Wanted change

Clarification on whether the Database, User, and Password environment variables are required or can be changed after the container is set up.

If I initialize the container with MYSQL_DATABASE, MYSQL_USER, and MYSQL_PASSWORD, will changing them in the future have any effect? Can they be deleted after first run when the database is set up or will removing them remove the database that was created?

Reason for change

Clarification

Proposed code change

No response

github-actions[bot] commented 1 month ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

LinuxServer-CI commented 3 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

chelming commented 3 weeks ago

pls keep open :)

j0nnymoe commented 3 weeks ago

Readme already states those are optional:

      - MYSQL_DATABASE=USER_DB_NAME #optional
      - MYSQL_USER=MYSQL_USER #optional
      - MYSQL_PASSWORD=DATABASE_PASSWORD #optional

Also a couple mentions here https://github.com/linuxserver/docker-mariadb?tab=readme-ov-file#application-setup that these ENV's specifically for username/passwords are one time only.

chelming commented 3 weeks ago

Being optional doesn't address the question about what happens if you define them on first boot and then subsequently change them. The only call-out is for the root password, but it doesn't mention the DB, user, or (non-root) password.

My assumption is that once the database is created, the env vars won't be used but the docs aren't clear on whether or not that's the case. If that is the case, some text like what mongo uses would make that clear:

When you start the mongo image, you can adjust the initialization of the MongoDB instance by passing one or more environment variables on the docker run command line. Do note that none of the variables below will have any effect if you start the container with a data directory that already contains a database: any pre-existing database will always be left untouched on container startup.