G
G
gitdev2020-11-05 12:17:38
Docker
gitdev, 2020-11-05 12:17:38

I can’t connect to MySQL which is Docker, while the code itself is a separate project without docker, what’s the problem?

Docker:

services:
...
  aero-core-db:
    image: mysql:5.7
    restart: always
    env_file:
      - database.env
    ports:
      - "33015:33015"
    expose:
      - '3306'


'development' => [
            'adapter' => 'mysql',
            'host' => 'aero-core-db',
            'name' => 'aero_core',
            'user' => 'aero_core_default',
            'pass' => '7!kw58$14vaWgk',
            'port' => '33015',
            'charset' => 'utf8',
        ]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2020-11-05
@gitdev

at the same time, the code itself is a separate project without a docker,
Do you mean the webserver is running separately from docker?
'host' => 'aero-core-db',
This alias is available from the docker container, you will have it 127.0.0.1... If you are running Docker locally

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question