Search code examples
symfonyrootaccess-denied

Access denied for 'root'@'localhost' but I'm not root


I developed a little management application with Symfony. It works a lot on local. I put it all on my webserver (called Planethoster), and I've got the following message when I try to login in my application using app.php:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

But in my parameters.yml file, I have not put the root user, it's another standard user that can only SIUD. I believe that app.php does not load my parameters.yml or config.yml file.

The last but not the least, I can log in using app_dev.php. It works but not with app.php.


Solution

    1. Verify your Database settings in app/config_prod.yml for production use.
    2. clear your cache by php app/console cache:clear --env=prod