Sequel Pro with Mysql in Docker

后端 未结 5 1059
挽巷
挽巷 2021-02-05 07:02

I build 2 docker container with docker-compose. I use Docker on Mac, no boot2docker.

version: \'2\'
    services:
        drupal-web:
            image: drupal:         


        
5条回答
  •  臣服心动
    2021-02-05 07:07

    Map host port 4306 (or any other available port) to docker mysql 3306 like:

    mysql-server:
            image: mysql
        environment:
            MYSQL_DATABASE: drupal
            MYSQL_ROOT_PASSWORD: root
            MYSQL_USER: drupal
            MYSQL_PASSWORD: drupal
        ports:
          - "4306:3306"
    

    You should be able to connect to docker mysql with 127.0.0.1:4306

    mysql -u drupal -h 127.0.0.1 -P 4306 -p
    

提交回复
热议问题