i'm trying to upload diffrent variables to my mySQL database but i can't get it to inject the info correctly. this has something to do with my queries. Can someone help me?
Are you putting that into msg.topic? I think you are just missing a quote or two.
Edit - If your data contains strings you may need to wrap it in single quotes, for example + " '" + flow.get('machine') +"'," (Single quotes inside the double quotes)
I misinterpreted the error. It is saying user lgout_dev on machine %. I don't know what the % means.
Can you connect to the database using a different sql client from the machine running node-red?
In that case it is the permissions that the user has in the database. The user possibly only has read permissions. If the permissions look ok then can that user write to the database from the machine running node red, using a different mysql client (such as the command line client)?
@zenofmud & @Colin I thought that as well but i checked of the user has the required permission and those are all selected so that can't be the problem. But what dou you mean with client? You mean a library you can download from the manage palette section?
A client is an application using another application. So in this case node-red is a client trying to use the mysql server. In order to determine whether it is a node-red problem then you can connect to the server using a different piece of s/w. Such as this one: https://dev.mysql.com/doc/refman/8.0/en/mysql.html
The syntax error shown in your debug output is complaining about the "+" signs in your select statement. This section is written as if it is being interpreted by a function node, NOT the template node -- which just does simple string substitution. If all of your values are numbers, then your template should look more like this:
This will only work IF mustache substitution works for flow.get('xxx') inside the curly braces -- which I admit I have never tried to do. The use of flow context should generally be avoided, and the query values would then come from msg fields instead.
Add a debug node (set to display the complete msg object) connected to the output of the template. Run the flow and expand the debug output to show the topic and copy and paste that to a reply. This way we can see what the statement is.