Mage.ai in Docker with MYSQL in Docker 2003 (HY000): Can't connect to MySQL server on '*********:33060' (99)

119 Views Asked by At

I am using a data pipeline tool and I'm trying to integrate with a MYSQL database in Docker "local-mysql" that has its own container on port 3306. While the data pipeline tool called Mage.AI is also in Docker in it's own container. How can I connect the data pipeline tool to see the "local-mysql" container?

see configs I have in the tool below:

database: kdtestdb
host: localhost
port: 3306
username: root
password: mypassword
connection_method: direct
ssh_host: null
ssh_port: 22
ssh_username: null
ssh_password: null
ssh_pkey: null

PS: I created my mysql container with this command:

docker run --name local-mysql -e MYSQL_ROOT_PASSWORD=mypassword -p 3306:3306 -d mysql:latest 
1

There are 1 best solutions below

0
On

This solution by Thomasleveil solved by problem:

From inside of a Docker container, how do I connect to the localhost of the machine?

i.e. host.docker.internal