stratboy's avatar

How to connect to db via GUI when using Docker?

Hi! I'm using Docker and I'm new to it as well as Laravel (sort of..). I have a sample Laravel app running, all fine. Now I want to take a look to the db with a gui (sequel pro). The configurations are default ones:

.env:

DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=testsite4
DB_USERNAME=sail
DB_PASSWORD=password

docker_compose:

    environment:
        MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
        MYSQL_ROOT_HOST: "%"
        MYSQL_DATABASE: '${DB_DATABASE}'
        MYSQL_USER: '${DB_USERNAME}'
        MYSQL_PASSWORD: '${DB_PASSWORD}'
        MYSQL_ALLOW_EMPTY_PASSWORD: 1

Can't get a connection currently... What params should I use in sequel pro (tcp/ip) with the above default config?

Thank you

0 likes
2 replies
Sinnbeck's avatar

In docker-compose you can add ports to expose under mysql

ports:
    - 3307:3306

Rerun the containers and you may connect on port 3307

stratboy's avatar

Thank you, in fact I was able to connect on port 3306 using table plus instead of sequel pro. Not sure why, maybe because sequel pro is running under mysql v5.7 while table plus defaults to mysql 8?

Please or to participate in this conversation.