I’m having trouble connecting to my MySQL server, which is running in a Docker container. I’m 100% sure of the details of my setup, host name, DB, user, password. Yet no luck. I get hits error: Couldn’t connect with these settings
Retry
connect ECONNREFUSED 127.0.0.1:3306
–
I’ve verified the following:
The MySQL server is running in the Docker container.
The bind_address is set to *.
I can connect to the MySQL server using the command line from within the Docker container.
The user root has access from both localhost and %.
Despite this, I cannot connect to the MySQL server from n8n. I’ve double-checked the connection settings, but it still fails.
Any suggestions or troubleshooting steps would be greatly appreciated!
We see this a lot, If you are also running n8n in Docker trying to access 127.0.0.1 accesses the local host which would be the n8n container which wouldn’t have MySQL installed.
Can you try using either the Docker loopback address which could be something like 172.17.0.1 depending on configuration or try using the IP for the MySQL container and see if that helps.