Symfony 4 Doctrine can't connect to Docker MySQL
Try this :
doctrine: dbal: # configure these for your database server driver: 'pdo_mysql' server_version: '8.0.15' charset: utf8mb4 default_table_options: charset: utf8mb4 collate: utf8mb4_unicode_ci url: '%env(resolve:DATABASE_URL)%'
The mysql image is at the latest version of mysql.
The php image is missing the pdo_mysql
driver
it should be added in the Dockerfile like follows :
RUN docker-php-ext-install pdo pdo_mysql zip
After this, the image has to be rebuilt with the command :
docker-compose build