Skip to content
Advertisement

Doctrine insists on trying to use PostgreSQLDriver despite contrary config

I am setting up a Symfony 5.2 app, using doctrine/doctrine-bundle 2.4 and doctrine/orm 2.9. My doctrine.yaml config file looks like this:

JavaScript

The problem is that when I run doctrine:fixtures:load, I get the following output:

JavaScript

It looks like Doctrine is trying to use the Postgre driver, though I have specified MySQL. Is there another place where I need to configure this? If so, how?

===

EDIT: It looks like DATABASE_URL is not available inside my Docker container, which is probably the source of the problem. I’ve verified that DATABASE_URL is defined in my .env file, and that my .env file is in the same folder as my docker-compose.yml file. Also, I have a setting like this for the environment variable in that docker-compose file:

JavaScript

So I’m not quite sure what’s wrong here.

Advertisement

Answer

I think you have a wrong DATABASE_URL in your .env file. Please check if it starts with mysql://.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement