We’ve been working with the original poster outside of this thread to resolve this issue. Just wanted to follow up on this thread in case anyone else out there runs into something similar.
First, note that when using Windows Subsystem for Linux (WSL) 2 and running Docker, there are several prerequisites and best practices to consider. These are outlined in Docker’s documentation.
Since WSL2 runs in a virtual network created by the Windows host, referencing localhost
from inside WSL2 will not resolve to the host. Here’s a StackExchange thread that describes this in greater detail.
To access the local host IP address from within your WSL2 Docker container, run the container with the environment variable -e "LOCAL_HOST=$(hostname).local"
and the --network host
flag.
In this case, since we’re connecting to MySQL on the host machine, in the Edge device workflow’s SQL Node, we use this as the SQL Server Address: {{agentEnvironment.LOCAL_HOST}}
.
This should allow connection from the WSL Docker container to the host machine’s SQL server.