Laravel Sail: Cannot see database on local machine

47 views Asked by At

I have started a fresh Laravel Sail project on MacOS. Everything seems to be working just fine. Database was created on Docker's side and I can do migrations and seed it from command line through sail.

However, I cannot see the database on my local machine when I connect it through graphical database management application like TablePlus.

docker-compose.yml

mysql:
    image: 'mysql/mysql-server:8.0'
    ports:
        - '${FORWARD_DB_PORT:-3306}:3306'
    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
    volumes:
        - 'sail-mysql:/var/lib/mysql'
        - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'

As far as I'm aware the volumes should provide bidirectional synchronization between databases on Docker and my Local machine, so I should be able to see them on my local computer.

What am I doing wrong?

0

There are 0 answers