1

I have installed a craft cms project with craftman which uses docker. Now I am trying to connect to the DB with sequel pro, but I can't. I have run the craftman ip command to get the ip of the docker container, which in my case was 172.17.0.2 and then I have run the docker ps command to get the port of the DB which was 3306/tcp. I have tried to connect with these settings then in sequel pro:

Host: 172.17.0.2
Username: root
Password:
Database: craft
Port: 3306

This is the output of docker ps:

c29d64fd09ca        mariadb:10.1        "docker-entrypoint..."   12 days ago         Up 14 hours         3306/tcp               forandringsfabrikkencraft_mysql_1

But, I can't connect. How can I get the settings to connect to DB in docker?

Leff
  • 1,968
  • 24
  • 97
  • 201
  • It might be the case that container port is not exposed, could you please provide an output of `docker ps`? – webdizz Jun 12 '17 at 11:13
  • I have edited my question with the output – Leff Jun 12 '17 at 11:40
  • 1
    Right, that means your container port is not exposed outside, when it's exposed you should get output like `one_of_host_interfaces:host_port:3306/tcp`. To achieve this craftman should have corresponding configuration. You can also expose port using container linking. You can link your cms container to another one and that container should expose port 3306 by default linked containers has ports visibility with each other. – webdizz Jun 12 '17 at 11:47

1 Answers1

3

I've experienced the same problem.

Running: $ docker ps

Gave the response: PORTS 0.0.0.0:3306->3306/tcp mysql-server

Which told me to use '0.0.0.0' as host IP.

Hope this helps.

Backspace
  • 71
  • 7