i saw in nodered documentation there is an existing node node-red-contrib-mysql2 node where it is possible to get parameters from incomming msg
"We can also send the server details using msg.server, without adding those details at node level"
As the documentation is light on this topic i m unable to do it working. Can you clarify the syntax we should use?
i use the following one but not working
var test= {Host:mariadb_Host,Port:mariadb_Port, Username: mariadb_Username, Password: mariadb_Password, Database: 'myDatabase'}
newmsg.Server=test
yea the documentation is a bit limited on the node but if you go to Import (Ctrl+I) > Examples
you should see an example flow for node-red-contrib-mysql2
i havent used the node but from the example
the database property should be db and not database
also you have used msg.Server with capital S. i believe it should be lowercase
var newmsg={};
newmsg.server={
"host":"11.1.1.228",
"port":"3306",
"username": "user",
"password": "@L8S",
"db": "test"
}
//newmsg.Password=mariadb_Password;
newmsg.topic="select id,profileName from ProfileEntity;";
//node.log("------ GET ProfileEntity mysql(req)="+newmsg.topic);
node.warn(newmsg)
return newmsg;