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

Environment variable MYSQL_ROOT_PASSWORD not working #268

Closed
Lentolo opened this issue Oct 25, 2019 · 1 comment
Closed

Environment variable MYSQL_ROOT_PASSWORD not working #268

Lentolo opened this issue Oct 25, 2019 · 1 comment
Labels
question Usability question, not directly related to an error with the image

Comments

@Lentolo
Copy link

Lentolo commented Oct 25, 2019

Hi,
I am trying to create a docker container with the below script:

docker run
--name mydb
--publish 3306:3306
--env 'MYSQL_ROOT_PASSWORD=mySecret1!'
--env 'MYSQL_DATABASE=mydb'
--env 'MYSQL_USER=mydb'
--env 'MYSQL_PASSWORD=mydb1!'
--detach
mariadb:latest

Th container is created but the environment variables are not used.
No volumes are defined, and the image is the latest one.
What am i doing wrong?
Thanks

@Lentolo Lentolo changed the title Envirinment variables not working Environment variable MYSQL_ROOT_PASSWORD not working Oct 25, 2019
@wglambert wglambert added the question Usability question, not directly related to an error with the image label Oct 25, 2019
@wglambert
Copy link

Duplicate of #183

We don't escape any password characters since we didn't want to implement the equivalent of mysql_real_escape_string in bash and didn't want to burden the image with an install of a library/language just for this purpose.

The environment variables are added appropriately, but they contain invalid characters as input to mariadb

$ docker run --name mydb --publish 3306:3306 --env 'MYSQL_ROOT_PASSWORD=mySecret1!' --detach mariadb:latest
9879713f02479c9c1cf2553a4d1d8af0d95a4891e05f58ee415de6eb2e5d72e2

$ docker inspect 9879 | grep -i env -A1
            "Env": [
                "MYSQL_ROOT_PASSWORD=mySecret1!",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Development

No branches or pull requests

2 participants