Sample Header Ad - 728x90

Can't connect to Dockerized MariaDB ColumnStore database from host machine

0 votes
0 answers
745 views
I have setup a MariaDB ColumnStore Database as described in the MariaDB ColumnStore Quick Start guide. The guide is missing some steps so these are the exact steps I took:
docker run -d -p 3306:3306 --name mcs_container mariadb/columnstore

docker exec -it mcs_container bash

yum install git wget

git clone https://github.com/mariadb-developers/mariadb-columnstore-quickstart.git 

./get_flight_data.sh

mariadb

		CREATE USER 'user1'@'%' IDENTIFIED BY '';

		GRANT ALL ON travel.* TO 'user1'@'%';

Exit mariadb client

./create_and_load.sh 127.0.0.1 3306 user1
I can query the DB from within the container. Now, I want to connect to the DB from my local Windows 11 machine through TCP. But every time I try to connect to it using a local MySQL client I get the following error:
C:\Program Files\MariaDB 10.9\bin>mariadb --host 172.17.0.2  --port 3306 --user app_user -p
Enter password: ********
ERROR 2002 (HY000): Can't connect to server on '172.17.0.2' (10060)
*Edit*: I am using Docker Containers IP Address
.17.0.2
in the above request since I am trying to connect to the server/DB that is inside the container. I found the IP address through the following command:
docker inspect -f "{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}" mcs_container
For further clarity, the diagram below illustrates the setup and problem, the connection (middle arrow) is what is failing at the moment. enter image description here *Edit End* I did some trial and error through the research I found online but I have reached an impasse. I don't know what I am missing. Here are a few things I have tried: 1. Followed this video as well as section 2.3 of this article detailing how to connect to a containerized MariaDB/MySQL server. No luck. 2. I also looked into bind addresses as mentioned here . But as mentioned in this more recently answered question , bind addresses may not be the problem. And I don't exactly understand what I am messing with here. So I left it alone for now. 3. Last possibility I could think of is that it could be a firewall issue, as mentioned here . I use Kaspersky Internet Security - I tried disabling the firewall but again that made no difference. I am new to docker, sorry if I have overlooked something small and obvious. Any help will be really appreciated. Thank you.
Asked by Malvi Bid (1 rep)
Oct 21, 2022, 03:28 PM
Last activity: Oct 21, 2022, 06:58 PM