MySQL problem

Hi, I have a problem setting up a connection to the MySQL database. I keep getting connect error “ERROR: connect ETIMEDOUT”. IP address added to Whitelist (51.116.108.244).
Generally, I want new rows in the database to be added to Google Sheets and I don’t know how to do that.

ERROR:
ERROR: connect ETIMEDOUT

Error: connect ETIMEDOUT
    at Object.createConnection (/usr/local/lib/node_modules/n8n/node_modules/mysql2/promise.js:231:31)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/MySql/MySql.node.js:154: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:395:62



Hi @SELLIFIC

Welcome to n8n Community.

This is how I created a new n8n user in MySQL. Because I want to keep it separate.

CREATE USER 'n8n'@'IP' IDENTIFIED BY 'PASSWORD';

GRANT ALL PRIVILEGES ON *.* TO 'n8n'@'IP' WITH GRANT OPTION;

FLUSH PRIVILEGES; 

In my case. The MySQL Database in Present in Different Server. (This works on the Same Server too)

Example:

CREATE USER 'n8n'@'51.116.108.244' IDENTIFIED BY 'PASSWORD';

GRANT ALL PRIVILEGES ON *.* TO 'n8n'@'51.116.108.244' WITH GRANT OPTION;

FLUSH PRIVILEGES;

Please make sure to allow 3306 Port

1 Like

Access via port 3306 is ok, with other applications work fine.

Problem Solved?

Unfortunately no, I meant with other applications the connection to the database works here unfortunately not: /

I just merged this PR:


Then you will be able to configure yourself how long the timeout should be. Maybe that fixes your problem. I will update here once it got released.
1 Like

What is the amount of results expected and how long does it take to run that query manually?

If it’s really big, manually split it up or optimize the query or table

The table is small - 5 columns and 30 rows.

A result that small should not time out, You said that applications on the same server, Same connection details dont have this problem?

I tried to connect to the Database from Integromat and Zapier and everything was ok.
I checked in n8n.cloud and n8n installed on Docker and the problem is on both.

The timeout is not for the execution, it is a connection timeout.

Got released with [email protected]

You can now try if it works when you increase the connection timeout in the credentials. Good luck!

Great, now it works. I installed n8n on docker compose and with [email protected] version everything is fine.

Thanks for the help!

2 Likes

Very happy to hear. Have fun!