Access denied to database while calling docker from command line

119 Views Asked by At

I took responsibility for a hughe project, a part of the project contains cronjobs to crawl data from a certain provider. The project is written in Yii2 and it runs in Lando enviroment with docker desktop, on a windows10 machine with wsl2. While working with the database container in phpmyadmin or in the browser everything connects nicely and runs fine. But if I try to call the cron from my windows or wsl console, I'm not able to connect to the database. (SQLSTATE[HY000] [1045] Access denied for user xxx@localhost, thrown by DB connector). The credentials are definitively valid, I'm using them all the time. The appserver container can communicate with the database.

I guess it has something to do with permissions windows host -> docker but I can't figure out where I have to change this this in docker or in lando (I'm not really experienced in docker unfortunately).

Any help or trick is welcome!

0

There are 0 best solutions below