P
P
parkito2017-04-04 20:52:32
linux
parkito, 2017-04-04 20:52:32

Why can't I run mysql on docker under windows?

Hello. Please help me fix the problem. I'm trying to run the official mysql dcker image from the hub

docker run --name db -d -e MYSQL_ROOT_PASSWORD=12345 -p 3306:3306 mysql:latest

The image downloads and starts working. Gets an address
"IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "c6afea81da99ce7116ab0d01a2f95cf850146cf0b9382c99933ee0c94a697dca",
                    "EndpointID": "922227091e059d25a528d2b76ebe0097d17772dc8c028b5b3652e15cad56502f",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02"
                }
            }
        }

However, the container is not accepting connections
./mysql.exe -uroot -p12345
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

When I knock on the address indicated in the inspection, I get a slightly different
./mysql.exe -uroot -h 172.17.0.2 -p214189
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on '172.17.0.2' (10060)

win10 host machine. I think the problem is in the network interfaces, but I can not identify the problem itself.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Eugene, 2017-04-04
@Jek_Rock

Try to specify the port as follows
AND correctly specify what you want to build the container from
-d mysql:latest

D
d-stream, 2017-04-04
@d-stream

are incoming/outgoing connections allowed in firewall rules?

G
Gusse, 2017-04-19
@Gusse

You must specify MYSQL_ROOT_HOST, i.e.:

docker run --name db -d -e MYSQL_ROOT_PASSWORD=12345 -e MYSQL_ROOT_HOST=172.17.0.1 -p 3306:3306 mysql:latest

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question