I tried this with port 3306 and got the following error: ERROR: Connection lost: The server closed the connection.
Error: Connection lost: The server closed the connection.
at Object.createConnection (/usr/local/lib/node_modules/n8n/node_modules/mysql2/promise.js:241:31)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/MySql/MySql.node.js:220:41)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:492:37)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:424:62
at processTicksAndRejections (internal/process/task_queues.js:93:5)
I also tried with port 3307 and got this error: ERROR: connect ECONNREFUSED 172.17.0.1:3307
Error: connect ECONNREFUSED 172.17.0.1:3307
at Object.createConnection (/usr/local/lib/node_modules/n8n/node_modules/mysql2/promise.js:241:31)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/MySql/MySql.node.js:220:41)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:492:37)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:424:62
at processTicksAndRejections (internal/process/task_queues.js:93:5)
I am creating a tunnel with ssh -Nv to initiate the tunnel from port 3306 to 3307 (my understanding of this is not great, but this is how i have set it up for other services we use)
And yes when connecting manually, ssh -Nv on the config file is running so the tunnel is created
You can connect to the docker container using the docker exec command but I suspect the issue is more around the SSH tunnel, What if you change LocalForward to LocalForward 0.0.0.0:3307 127.0.0.1:3306 it could be that for some reason the docker instance is not able to connect to it and that will sort it.