# Execute SQL method stops working in MySQL

**URL:** <https://community.n8n.io/t/execute-sql-method-stops-working-in-mysql/27346>\
**Category:** Questions\
**Tags:** data-transformation, node, mysql\
**Created:** [June 21, 2023, 6:01pm UTC](https://community.n8n.io/t/execute-sql-method-stops-working-in-mysql/27346 "2023-06-21T18:01:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IndieDev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/indiedev/32/44205_2.png) [@IndieDev](https://community.n8n.io/u/IndieDev)\
**Post date:** [June 21, 2023, 6:01pm UTC](https://community.n8n.io/t/execute-sql-method-stops-working-in-mysql/27346/1 "2023-06-21T18:01:27Z")

</div>

Hello.  
Everything was working fine until recently. But now MySQL queries have stopped running.  
Only simple sampling without conditions and only if I don’t use Execute SQL.  
All other queries are terminated with “true” message and that’s it. No output data about the sample is given.  
May be it is some kind of bug.  
I have a selfhosted n8n instance. I updated to the latest version and the error is still there.  
Please help the community and experts.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/a/1/a14d2603d1694a894ed0a5d7afaae02d6458f64e.png)  
 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/2/8/28b277ad8a3a911bec230816405933d47d9fe4f6.png)  
 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/0/3/03f8f19445a65167cff5bc39f07fa151371bac55.png)

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [June 22, 2023, 6:59am UTC](https://community.n8n.io/t/execute-sql-method-stops-working-in-mysql/27346/3 "2023-06-22T06:59:07Z")

</div>

Hi @IndieDev, I am very sorry to hear you’re having trouble.

I’ve set up a dummy database including two tables with the below structure to reproduce this:

```sql
CREATE TABLE `authors` (
  `id` int NOT NULL AUTO_INCREMENT,
  `first_name` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL,
  `last_name` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL,
  `birthdate` date NOT NULL,
  `added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci

CREATE TABLE `posts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `author_id` int NOT NULL,
  `title` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` varchar(500) COLLATE utf8mb3_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb3_unicode_ci NOT NULL,
  `date` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci

```

I’ve then added a bunch of dummy data and tried a number of different queries using n8n, but was seeing the expected result every time, even when including conditions or joins. For example using this workflow:

Result:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/e/e/ee4aedd47e350234f7f4d7b3bf50d02913730b4a.png)

Perhaps you can provide an example database schema and workflow using which your problem can be reproduced?

---

<div class="post-metadata">

**Author:** ![IndieDev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/indiedev/32/44205_2.png) [@IndieDev](https://community.n8n.io/u/IndieDev)\
**Post date:** [June 22, 2023, 3:58pm UTC](https://community.n8n.io/t/execute-sql-method-stops-working-in-mysql/27346/4 "2023-06-22T15:58:17Z")

</div>

Thank you very much for your help.  
Now everything seems to be working as it should.  
The sql code is now running with conditions and subqueries.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/36532_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [September 20, 2023, 3:58pm UTC](https://community.n8n.io/t/execute-sql-method-stops-working-in-mysql/27346/5 "2023-09-20T15:58:53Z")

</div>

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