1

Currently I'm facing an issue trying to connect to my mariadb database running in an docker-container.

My Local Information:

  • OS: Windows 10
  • Docker-Toolkit
  • Trying to connect from MySql Workbench Workbench config
  • Docker ps returns following:

Docker List

Testing the connection I only get the error message "Failed to Connect to MySQL at 127.0.0.1:3306 with user root. Can't connect to MySQL server on '127.0.0.1' (10061)". Error Message

Trying to connect using MySql-Workbench from my virtual machine (Ubuntu) it works without problems.

Does someone have an idea how to solve that issue?

Update:

I started the docker container using docker-compose:

 mysql:
image: mariadb:10.1
ports:
  - "127.0.0.1:3306:3306"
environment:
  MYSQL_DATABASE: databasename
  MYSQL_ROOT_PASSWORD: pw
volumes:
  - myproject-mysqldata:/var/lib/mysql
networks:
  - back
logging:
  options:
    max-size: "25m"
    max-file: "4"

Update 2:

Also tried to connect using Squirel with MariaDB Driver. Also doesn't work. It seems, that windows can't find the 127.0.0.1:3306.

"Telnet 127.0.0.1 3306" also responded with a not found message.

What I'm doing wrong here? Is it maybe due to the docker-toolbox and Virtualbox usage?

Solution:

Hey all, thank you for your help. I tried to put my won information into a blog-post hoping that it can help someone: Solution

SNO
  • 793
  • 1
  • 10
  • 30

1 Answers1

0

What I'm doing wrong here? Is it maybe due to the docker-toolbox and Virtualbox usage?

One of the Cons mentioned here: Should You Install Docker With the Docker Toolbox or Docker for Mac / Windows? states:

Docker Toolbox

Cons

  • Not a native solution, so you’ll need to access your Docker Machine’s IP address if you’re developing web apps. Example: 192.168.99.100 instead of localhost.

and I think the same is also mentioned here: Docker Toolbox - Localhost not working

In Toolbox, nothing will be localhost, and will be 192.168.99.100 by default, since it's running a Linux VM in VirtualBox.

Community
  • 1
  • 1
tgogos
  • 23,218
  • 20
  • 96
  • 128
  • Great. Many Thanks. You gave me exactly that information I needed to solve my problem. Thank you. – SNO Jan 18 '18 at 16:25