# "Deploy failed: No response from server" when inserting into MySQL

**URL:** <https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822>\
**Category:** General\
**Created:** [5 December 2019 11:00 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822 "2019-12-05T11:00:22Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://discourse.nodered.org/u/Sagar)\
**Post date:** [6 December 2019 11:11 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/21 "2019-12-06T11:11:15Z")

</div>

The same flow I have posted which is giving the deploy failed message:

```auto
[{"id":"2867501b.43456","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"560199de.cdcaf8","type":"mysql","z":"2867501b.43456","mydb":"2a44bcb3.ad6994","name":"","x":550,"y":180,"wires":[["6d7e9abd.a213b4"]]},{"id":"6d7e9abd.a213b4","type":"debug","z":"2867501b.43456","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":750,"y":180,"wires":},{"id":"845ca325.9ebb2","type":"inject","z":"2867501b.43456","name":"","topic":"","payload":"{"message":"Foo"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":180,"wires":[["7303633e.cac12c"]]},{"id":"7303633e.cac12c","type":"function","z":"2867501b.43456","name":"","func":"msg.topic = "INSERT INTO aress_test (message) VALUES (?);"\nmsg.payload=[msg.payload.message];\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":180,"wires":[["560199de.cdcaf8"]]},{"id":"2a44bcb3.ad6994","type":"MySQLdatabase","z":"","host":"localhost","port":"3306","db":"AressSensorData","tz":""}]

```

* * *

If we use any other query except the INSERT in the Function node in the given flow, the deployment will be successful.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [6 December 2019 11:26 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/22 "2019-12-06T11:26:58Z")

</div>

In the screenshot for your template node you seem to be setting the query into msg.payload... it needs to be in msg.topic as per the info sidebar

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 December 2019 11:48 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/23 "2019-12-06T11:48:19Z")

</div>

> [@Sagar](#):
>
> The same flow I have posted which is giving the deploy failed message:

There is a syntax error in the json for that flow (the second one you posted), which may explain why it will not deploy. Try to import it and it shows the error. I will have to leave it to others to comment on how that may have come about and what to do about it.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [6 December 2019 12:51 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/24 "2019-12-06T12:51:12Z")

</div>

@Sagar Your flow does not import

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [6 December 2019 13:04 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/25 "2019-12-06T13:04:49Z")

</div>

@Sagar well I was able to hack and import your flow (removed the function code and added back after doing the import). I created the DB and the table and ran the flow and it works fine fo me.

This tells me that it is something to do with your environment or permissions although if I use a ser without insert permission, I get an expected

```auto
Error: ER_TABLEACCESS_DENIED_ERROR: 
INSERT command denied to user 'paul'@'localhost' 
for table 'aress_test'"

```

error from the node

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://discourse.nodered.org/u/Sagar)\
**Post date:** [7 December 2019 03:03 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/26 "2019-12-07T03:03:50Z")

</div>

@zenofmud Thank you for the efforts.

As far as permissions are concerned, I have granted all the privileges for the user that I am using.

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://discourse.nodered.org/u/Sagar)\
**Post date:** [7 December 2019 03:05 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/27 "2019-12-07T03:05:44Z")

</div>

@Colin The first flow which I have posted is the same as the second one. The syntax error might have occur because I have exported the flow which had "Deployment Failed Error"

---

<div class="post-metadata">

**Author:** ![Esa](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@Esa](https://discourse.nodered.org/u/Esa)\
**Post date:** [7 December 2019 05:21 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/28 "2019-12-07T05:21:31Z")

</div>

@Sagar I replicated your issue on my test server, created a mysql user with all the privileges and tried to insert into database using a function node, even I am facing the error 'Deploy Failed. No Response from server'.

When I tried the 'REPLACE INTO' query, instead of 'INSERT INTO' it was successfully deployed and the data was inserted into the database. Can't figure out what is the issue with the 'INSERT' query.

Please check the flow below:

`[{"id":"ae2c51af.ede1a","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"772a94ed.a1d10c","type":"mysql","z":"ae2c51af.ede1a","mydb":"9bd6189c.4d77e8","name":"","x":640,"y":240,"wires":[[]]},{"id":"fb2d008f.830f7","type":"inject","z":"ae2c51af.ede1a","name":"","topic":"","payload":"{\"temp\":\"10\",\"humidity\":\"21\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":240,"wires":[["abe9cbe0.c760a8"]]},{"id":"abe9cbe0.c760a8","type":"function","z":"ae2c51af.ede1a","name":"Replace","func":"msg.topic = \"REPLACE INTO sensor_data(temp,humidity) VALUES ('\"+msg.payload.temp+\"','\"+msg.payload.humidity+\"')\";\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":240,"wires":[["772a94ed.a1d10c"]]},{"id":"9bd6189c.4d77e8","type":"MySQLdatabase","z":"","host":"localhost","port":"3306","db":"sensor","tz":""}]`

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 December 2019 09:59 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/29 "2019-12-07T09:59:11Z")

</div>

@Esa Could you get it to the point where the deploy fails, and then export the nodes and post here please. I want to see if it is the same syntax problem that is seen on @sagar's second flow.

---

<div class="post-metadata">

**Author:** ![Esa](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@Esa](https://discourse.nodered.org/u/Esa)\
**Post date:** [7 December 2019 10:40 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/30 "2019-12-07T10:40:49Z")

</div>

@Colin , Please find the flow below for which the deployment is failing:

`[{"id":"ae2c51af.ede1a","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"772a94ed.a1d10c","type":"mysql","z":"ae2c51af.ede1a","mydb":"9bd6189c.4d77e8","name":"","x":640,"y":240,"wires":[["5a797f0.1deca8"]]},{"id":"fb2d008f.830f7","type":"inject","z":"ae2c51af.ede1a","name":"","topic":"","payload":"{\"temp\":10,\"humidity\":21}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":240,"wires":[["abe9cbe0.c760a8"]]},{"id":"abe9cbe0.c760a8","type":"function","z":"ae2c51af.ede1a","name":"Insert","func":"msg.topic = \"INSERT INTO sensor_data(temp,humidity) VALUES ('\"+msg.payload.temp+\"','\"+msg.payload.humidity+\"');\"\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":240,"wires":[["772a94ed.a1d10c"]]},{"id":"5a797f0.1deca8","type":"debug","z":"ae2c51af.ede1a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","targetType":"msg","x":860,"y":240,"wires":[]},{"id":"9bd6189c.4d77e8","type":"MySQLdatabase","z":"","host":"127.0.0.1","port":"3306","db":"sensor","tz":"GMT +5.30"}]`

Sagar's second flow has syntax error but his first flow is without syntax error.

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://discourse.nodered.org/u/Sagar)\
**Post date:** [7 December 2019 10:43 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/31 "2019-12-07T10:43:02Z")

</div>

@Colin:  
Apologize for the syntax error in 2nd flow. I copied the first flow only to format it in a right way. There must have been some error while copying. But you can check with my first flow which is the same as second one.

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://discourse.nodered.org/u/Sagar)\
**Post date:** [7 December 2019 10:44 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/32 "2019-12-07T10:44:28Z")

</div>

@Esa: Exactly.. This is the same issue I am facing. Thanks for posting.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 December 2019 10:57 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/33 "2019-12-07T10:57:53Z")

</div>

@Esa - I imported your flow and the insert works fine for me.

Both of you, what verion of mySQL are you using? (from a terminal enter `mysql -v`). I'm running  
`Server version: 5.6.19 MySQL Community Server (GPL)`

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 December 2019 10:58 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/34 "2019-12-07T10:58:22Z")

</div>

@sagar, no need to apologise, I suspect that this may be key to the problem. Make the deploy fail and then export again and post it here again. It could be that the error in the exported code is exactly the reason it cannot deploy, as it is trying to deploy an invalid flow.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 December 2019 11:06 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/35 "2019-12-07T11:06:49Z")

</div>

Could the mysql version explain a deploy failure?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 December 2019 11:25 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/36 "2019-12-07T11:25:58Z")

</div>

I'm not sure, but something is different about their setup and mine. The deploy might causing a new connection to the DB which might cause a problem(??)

@Sagar @Esa what type of deploy have you got setup? i.e.  
 ![Screen Shot 2019-12-07 at 6.25.24 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0899940a82b300b5d0953e2f13e227f0213fbfc3.png)

---

<div class="post-metadata">

**Author:** ![Esa](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@Esa](https://discourse.nodered.org/u/Esa)\
**Post date:** [9 December 2019 04:05 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/37 "2019-12-09T04:05:36Z")

</div>

@zenofmud, MySQL version is  
`mysql Ver 14.14 Distrib 5.7.28, for Linux (x86_64) using EditLine wrapper`

Node-Red version:  
` Node-RED version: v1.0.3`  
Deployment Type:  
`Full`  
I even tried using `Modified Flows`, but no success.

---

<div class="post-metadata">

**Author:** ![AK51](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ak51/32/8438_2.png) [@AK51](https://discourse.nodered.org/u/AK51)\
**Post date:** [18 June 2021 04:51 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/38 "2021-06-18T04:51:29Z")

</div>

Hi, I have the same problem. After insert an query, the node-red stopped.  
I have tried a 32bit window system and raspberry pi. Same problem...  
Here is the video, pls take a look

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/257b1258dfde30a1c7aa316f25fb5f3e730366eb.jpeg "mySQL kill node-red after INSERT?") ](https://www.youtube.com/watch?v=-gBku_g6tig)

I played with mysql last year and everything was fine. I wonder if there is any update that crash the node-red? Thx

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [18 June 2021 10:18 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/39 "2021-06-18T10:18:44Z")

</div>

This thread is over two years old, please open a new thread and provide some more information  
what version of NR and node.js?  
what device is running NR?  
what device is running mysql?  
what version of mysql?  
what is showing in the NR log (do a copy and paste)  
a copy of your flow.

I'll close this thread now.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [18 June 2021 10:18 UTC](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822/40 "2021-06-18T10:18:53Z")

</div>

Closed on 18 June 2021 10:18 UTC



[Previous page](https://discourse.nodered.org/t/deploy-failed-no-response-from-server-when-inserting-into-mysql/18822.md?page=1)
