MySQL SQL Syntax ERROR

When I Execute Query which has both DROP TABLE IF EXISTS table; CREATE TABLE IF NOT EXISTS table( etc., I get the following error:

ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE IF NOT EXISTS `Contacts`( `id_sql` int unsigned NOT NULL AUTO_INCRE' at line 1

When I run the DROP TABLE and CREATE TABLE separately, it works fine.

Any idea what I might be doing wrong?

Hi @dickhoning, your queries look good to me. It seems this is just a case of n8n only handling a single query per node execution. You would get the same result when trying to execute something as simple as SELECT 1; SELECT 2;

With the MySQL node being more limited than the Postgres node for example you might want to open a feature request with any such missing functionality so the team can consider implementing it.

In the meantime, I think the only option would be to use two separate MySQL nodes (one for each query).

1 Like

Hi @MutedJam I split the query into single queries, and now it works. Thanks!

I’ll send a feature request for the MySQL node as soon as I’ve got my Wishlist complete :wink:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.