Hi everyone, I have a problem connecting with the ...
# ask-questions
w
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
Hi Bhaskar! You might need to switch Docker to use host networking if you want to connect to a database on localhost
w
Hi Jeremy thanks that was going to be my next step
f
Are you on Mac, Windows, or Linux?
w
Mac
f
You can try using
host.docker.internal
instead of
127.0.0.1
w
let me try
just fyi
yes that fixed it
wonderful -- thanks so much for the quick response
is this a CORS issue?
f
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
got it thank you