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

Access denied for user 'root'@'192.168.99.1' #241

Closed
whgibbo opened this issue Nov 25, 2016 · 5 comments

Comments

@whgibbo
Copy link

commented Nov 25, 2016

Hi,
Been using the mysql/mysql-server docker image for a while :)
However just recently setup a new machine and when it pulled down the latest image and now getting the following error when attempt to connect to it remotely:
Access denied for user 'root'@'192.168.99.1'

Also can't connect to it remotely using mysql workbench. So has root access now been restricted to the localhost ?

The docker image that doesn't work has the following when using docker inspect:

"Id": "sha256:6272a6121ff654771f3b893c4d4d1f5da8f5a71d4baecc66c58a630ed8307117",
"RepoTags": [
"mysql/mysql-server:latest"
],
"RepoDigests": [
"mysql/mysql-server@sha256:7dceee67e23c8a498a0de1e8d8aa03b5b2fa32f3d32244c71e0cf38ff49ffcf4"
],
"Parent": "",
"Comment": "",
"Created": "2016-11-22T13:06:24.885021746Z",

The docker image that does work has the following when using docker inspect:

"Id": "sha256:190154079ff8506e17b956aa8772b2fc4826c998db0f82fc91eef9f95eb076b4",
"RepoTags": [
"mysql/mysql-server:latest"
],
"RepoDigests": [],
"Parent": "",
"Comment": "",
"Created": "2016-10-13T12:49:26.931612156Z",
"Container": "eab604187e802e2689ba0c9bd56b57281eece312048db83a0aa6c73467c3282e",

Just wanted to know if there is a change in approach or a bug..

Thanks

@ltangvald

This comment has been minimized.

Copy link
Collaborator

commented Nov 25, 2016

Hi,

Yes, this is for upstream's Docker image, which now restricts root to localhost by default. You can override by sending in the environment variable MYSQL_ROOT_HOST. Setting it to "%" will give the old behavior (noted in the readme at https://hub.docker.com/r/mysql/mysql-server/)

@ltangvald

This comment has been minimized.

Copy link
Collaborator

commented Nov 25, 2016

To explain it a bit more. If you pass in a value for the MYSQL_ROOT_HOST variable, a second root account will be created for the value you used, so you'll have 'root'@'localhost' and 'root'@'${MYSQL_ROOT_HOST}'

@whgibbo

This comment has been minimized.

Copy link
Author

commented Nov 26, 2016

Thanks, I'll give that a try :)

@whgibbo

This comment has been minimized.

Copy link
Author

commented Dec 1, 2016

That worked, thanks :)

@ltangvald

This comment has been minimized.

Copy link
Collaborator

commented Dec 2, 2016

Good to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.