Title
j

Josef Henryson

09/09/2019, 2:34 PM
Hi, I started a Prisma server with MySQL in local docker from a tutorial. I would like to be able to look into MySQL database with Sequel Pro, but it fails to connect. It seems like the port is not public / available in the host:
$ docker port prisma-test_mysql_1 3306
Error: No public port '3306/tcp' published for prisma-test_mysql_1
Any ideas how I can do this?
d

divyendu

09/09/2019, 2:41 PM
Please share your
docker-compose
file
If you used Prisma init, there should be a commented part of code in docker-compose that mentions on how you can expose it for external clients! I can help you add it if you are able to share your docker-compose file with me
j

Josef Henryson

09/09/2019, 2:42 PM
version: '3'
services:
  prisma:
    image: prismagraphql/prisma:1.34
    restart: always
    ports:
      - '4466:4466'
    environment:
      PRISMA_CONFIG: |
        managementApiSecret: 504b299af5e06294c426f858c39ff15b24297ee18e7e98abde0255d70c2cabdb
        port: 4466
        databases:
          default:
            connector: mysql
            host: mysql
            port: 3306
            user: root
            password: prisma
  mysql:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: prisma
    volumes:
      - mysql:/var/lib/mysql
volumes:
  mysql: ~
d

divyendu

09/09/2019, 2:44 PM
You can add a ports secttion to the mysql part
mysql:
   image: mysql:5.7
   restart: always
   ports:
      - '3306:3306'
   environment:
     MYSQL_ROOT_PASSWORD: prisma
   volumes:
     - mysql:/var/lib/mysql
Then do a
docker-compose up -d
in the same folder as the docker compose file!
j

Josef Henryson

09/09/2019, 2:46 PM
ok, and the which IP should I use to connect? Is it the docker 192.168.99.100 or the container IP?
d

divyendu

09/09/2019, 2:47 PM
localhost: 3306 after this should work.. ports from docker essentially maps a docker port to localhost port
j

Josef Henryson

09/09/2019, 2:47 PM
wow, thatโ€™s awesome, it works! Thank you! ๐Ÿ™๐Ÿผ
๐Ÿ‘ 1