0

Using latest Docker desktop and mariadb/latest image I have created a container, which runs OK, local MySQL command work successfully.

BUT whatever I try to connect to the container with HeidiSQL, I get

"Can't connect to MySql server on 0.0.0.0 (10049)"

I think I have read at least 50 different "solutions" here and on other sites, but whatever I do, I get the same error, whatever IP I use.

Running Windows 10 Pro freshly updated, as with latest Docker desktop. Created the container with

docker run -p 3306:3306 --name demo -e MYSQL_ROOT_PASSWORD=xyz -d mariadb/server --log-bin --binlog-format=MIXED

Changed binding in my.cnf to 0.0.0.0 Granted all rights to 'root'@'%' thru local mysql cli.

Restarted the whole shebang NUMEROUS times

Tried connections on 0.0.0.0, 127.0.0.1, localhost, 172.17.0.2, etc, etc, etc. "docker ps" says PORT: "3306/tcp"

Using bash in the container, I can reach out and apt update etc, etc.

I'm out of options. Is there a kind guru out there with a new suggestion?

user207421
  • 305,947
  • 44
  • 307
  • 483
WannBo
  • 49
  • 2
  • 7
  • 1
    0.0.0.0 is not a valid target address for TCP connect. You have to provide an IP address and port where the server is actually listening. Clearly you have not yet done so. – user207421 Feb 16 '20 at 01:46
  • 1
    You should be able to connect to `127.0.0.1` port `3306`. All zeroes is not a real address, it's only used for binding purposes. Make sure your Docker instance is configured to listen on `0.0.0.0` though. – tadman Feb 16 '20 at 01:47
  • you can check with tcpview from sysinternls if something is listening on port 3306 – nbk Feb 16 '20 at 02:08
  • The fundamental question here is what is the IP address of the container? It certainly *isn't* 127.0.0.1. – user207421 Feb 16 '20 at 06:46
  • Kindly read the entire question before you answer. I have tested a number of IP-addresses, where 0.0.0.0 - which IS a suspicious address - is mentioned on several "solutions". I did not expect it to work, but it seems to have worked for several others? tcpview on the host (good suggestion, revealed interesting things!) does not say anything about anything docker related. docker inspect on the container says IP = 172.17.0.2 and 3306/tcp. – WannBo Feb 16 '20 at 10:18
  • I am unable to find anywhere in your question where you state that the IP address of the container is 172.17.0.2, even after kindly re-reading it. – user207421 Feb 17 '20 at 02:49

0 Answers0