Skip to content
Advertisement

Connection refused to database (Symfony 5) [closed]

I’m trying to connect my database to my app with Symfony but I keep getting errors. I specify that it’s not a local database. Also, I’m on Symfony 5 & PHP 7.4.

First, I put this in my .env file

JavaScript

All these informations seems to be good.

Next, here is my doctrine.yaml file

JavaScript

And then to test the connection to db, I made this code

JavaScript

And I’m getting these errors

Could someone help me and tell me what i’m doing wrong ?

Advertisement

Answer

My problem is solved, I had to enable the extension “pdo_mysql” in my PHP.ini file. Thanks all for the help.

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