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

Yes. It has all the privileges. Delete and select queries are also working fine.

Is the MySQL database on the same or a different machine?
I just ran a test and inserts work fone for me. in my case MySQL is on the same machine as NR.

If you insert ran nee and tehn stopped, have you looked in the logs of the database to see if naything funky is happening there?

The MySQL database is on the same machine. Even I did setup a new server and tried the same activity on that server, still there was this issue.

Just now I tried using "REPLACE INTO" instead of "INSERT INTO" in my query and it worked fine!!
However, this is not the motive of the task I am doing.

I checked the MySQL logs but no log has been recorded for this issue.

feel like sharing your db schema and flow so I can try to reproduce it?

Below is the DB schema:

+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| message | varchar(30) | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+

Below is the flow that I am testing on:

[{"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":""}]

Please see this and edit your post accordingly so that we can import your flow

Also with that flow, when do you get the Deploy Failed message?

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

[{"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.

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

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.

@Sagar Your flow does not import

@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

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

error from the node

@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.

@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"

@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":""}]

@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.

@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.

@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.

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

@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)