Docker Community Forums

Share and learn in the Docker community.

Cannot connect to mysql container

Hello,
I am new to docker technology. I created mysql server with my own image and my simple table. The container is running fine, I can also login to the mysql server (utilizing command line) and I can do queries - but I cannot send data from my node-js server to this mysql container.

I found out IP of the mysql server with: docker inspect db2 | grep IPAddress

This IP I used in node-js for connection, but I cannot connect to that server.

I am using toolbox and windows 10. Any idea, where could be the problem?

Thanks in advance

Error: connect ETIMEDOUT 172.17.0.2:3306
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
--------------------
at Protocol._enqueue (c:\Program Files\Docker Toolbox\docker_chat\node-side\node_modules\mysql\lib\protocol\Protocol.js:144:48)
at Protocol.handshake (c:\Program Files\Docker Toolbox\docker_chat\node-side\node_modules\mysql\lib\protocol\Protocol.js:51:23)
at Connection.connect (c:\Program Files\Docker Toolbox\docker_chat\node-side\node_modules\mysql\lib\Connection.js:119:18)
at sendQuery (c:\Program Files\Docker Toolbox\docker_chat\node-side\backend.js:74:10)
at Server.<anonymous> (c:\Program Files\Docker Toolbox\docker_chat\node-side\backend.js:14:7)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at Server.emit (events.js:208:7)
at emitListeningNT (net.js:1382:10)
at _combinedTickCallback (internal/process/next_tick.js:135:11)