https://www.growthbook.io/ logo
w

wonderful-xylophone-6904

12/06/2021, 11:46 PM
Hi everyone, I have a problem connecting with the mysql data source. Specifically I receive the following error for Postgresql
Copy code
connect ECONNREFUSED 127.0.0.1:5432
for mariadb and mysql it's
Copy code
connect ECONNREFUSED 127.0.0.1:3306
f

future-teacher-7046

12/06/2021, 11:49 PM
Hi Bhaskar! You might need to switch Docker to use host networking if you want to connect to a database on localhost
w

wonderful-xylophone-6904

12/06/2021, 11:51 PM
Hi Jeremy thanks that was going to be my next step
f

future-teacher-7046

12/06/2021, 11:51 PM
Are you on Mac, Windows, or Linux?
w

wonderful-xylophone-6904

12/06/2021, 11:51 PM
Mac
f

future-teacher-7046

12/06/2021, 11:51 PM
You can try using
host.docker.internal
instead of
127.0.0.1
w

wonderful-xylophone-6904

12/06/2021, 11:52 PM
let me try
just fyi
yes that fixed it
wonderful -- thanks so much for the quick response
is this a CORS issue?
f

future-teacher-7046

12/06/2021, 11:56 PM
No, it's because
localhost
or
127.0.0.1
inside the GrowthBook Docker container does not reference your host machine. Instead you need to use a different IP address which Docker dynamically generates.
host.docker.internal
is just an alias for that IP
w

wonderful-xylophone-6904

12/07/2021, 12:06 AM
got it thank you
6 Views