Skip to content

added .cnf affects image initialization #490

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

Closed
taylorchu opened this issue Sep 13, 2018 · 3 comments · Fixed by #471
Closed

added .cnf affects image initialization #490

taylorchu opened this issue Sep 13, 2018 · 3 comments · Fixed by #471
Labels

Comments

@taylorchu
Copy link

If mysql .cnf is added when container starts, and it has a [client] section, incorrect password will be used in the init script.

[client]
user=root
password=unprotected
database=xxx_development

then init will fail like this:

mysql_1                  | MySQL init process in progress...
mysql_1                  | 2018-09-13T02:53:44.017882Z 29 [Note] Access denied for user 'root'@'localhost' (using password: YES)
mysql_1                  | MySQL init process in progress...
mysql_1                  | 2018-09-13T02:53:45.025505Z 30 [Note] Access denied for user 'root'@'localhost' (using password: YES)
mysql_1                  | MySQL init process in progress...
mysql_1                  | 2018-09-13T02:53:46.032175Z 31 [Note] Access denied for user 'root'@'localhost' (using password: YES)
mysql_1                  | MySQL init process in progress...
mysql_1                  | MySQL init process failed.

We should probably explicitly use password here:

mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" )

@ltangvald
Copy link
Collaborator

Maybe best to use --no-defaults for the client commands during init

@taylorchu
Copy link
Author

@ltangvald yes. will someone fix this today? it seems simple.

@ltangvald
Copy link
Collaborator

This should be fixed by pr #471 at least, but that may take some time.
As a workaround, maybe you can use a user initiated by MYSQL_USER instead?
If you supply MYSQL_USER, MYSQL_PASSWORD and MYSQL_DATABASE, the container will automatically create a user with that password that has full access to MYSQL_DATABASE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants