W
W
WhatYouDoing2019-03-17 18:02:24
Docker
WhatYouDoing, 2019-03-17 18:02:24

Why can't I connect to the database in docker?

Please explain to someone how to connect to the database in the docker.
In the admin, I go to the database, and in the lara, when I try to execute, php artisan october:upI try to fill in the tables from the database, then a hollow error.

[Illuminate\Database\QueryException]                                                                                                                                                              
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known (SQL: select * from information_schema.tables where table_schema = database an  
  d table_name = migrations)

here is a piece of .env file
DB_CONNECTION=mysql
DB_HOST=october_plasma_db
DB_PORT=3306
DB_DATABASE=database
DB_USERNAME=root
DB_PASSWORD=example

here is a piece from docker-compose
october_plasma_db:
        container_name: october_plasma_db
        image: mysql
        command: --default-authentication-plugin=mysql_native_password
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: example
        networks:
          - october_plasma_backend

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question