| Bug #87605 | MySQL Cluster entrypoint.sh does not handle MYSQL_PASSWORD as file path | ||
|---|---|---|---|
| Submitted: | 30 Aug 2017 13:15 | Modified: | 30 Aug 2017 13:25 |
| Reporter: | Sean McDowell | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Package Repos | Severity: | S3 (Non-critical) |
| Version: | OS: | Any | |
| Assigned to: | CPU Architecture: | Any | |
[31 Aug 2017 6:35]
Lars Tangvald
Hi, The MYSQL_USER|PASSWORD|DATABASE options are largely present for backwards-compatibility, as we recommend you instead use .sh or .sql scripts mounted to the /docker-entrypoint-initdb.d/ directory. If you create some init.sql that creates your users, databases, etc. Then add it to a directory that's bind-mounted to /docker-entrypoint-initdb.d/ at run time, it will automatically be executed during initialization of a new database. Does this cover your use case?

Description: Please add handling for MYSQL_PASSWORD similar as was done for MYSQL_ROOT_PASSWORD, i.e.,: if [ -f "$MYSQL_PASSWORD" ]; then MYSQL_PASSWORD="$(<$MYSQL_PASSWORD)" fi This is important for use with Docker Swarm where secrets are made available under /run/secrets/. How to repeat: Specify a path for the MYSQL_PASSWORD environment variable. The entrypoint.sh script does not handle loading the password from the file specified in the path, whereas it does so for MYSQL_ROOT_PASSWORD Suggested fix: Handle it the same as MYSQL_ROOT_PASSWORD