So both the app and database are in docker containers? On the same machine? Are you using docker-compose? What hostname is in your env file?
Jul 25, 2022
8
Level 4
SQLSTATE[HY000] [1045] Access denied for user
getting this weird error when I run my laravel project in docker. I'm able to connect to the database and run queries, but when laravel tries to access the database it gives me this error. Typically this is a credentials error and I'm using the same username/password. I even checked my ip because I have it whitelisted on the cloud server where the db lives. Everything seems good and like I mentioned I can actually connect to the db and run queries, but as soon as the api tries to connect it gives me this error.... any thoughts on how to troubleshoot this?
Please or to participate in this conversation.