GoogleCloudPlatform / node-red-contrib-google-cloud

Node-RED nodes for Google Cloud Platform
Apache License 2.0
90 stars 57 forks source link

How to connect google MySQL with node red? #52

Closed azrulsalki closed 4 years ago

azrulsalki commented 4 years ago

Hi, currently i am developing my final year project regarding running a node red system and database in the cloud. I am using google cloud platform for this current project. I am wondering is there any way i could connect google MySQL database to the node-red running on my virtual machine? I tried using the MySQL pallette but it keep on giving me

"Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MariaDB client"

"Database not connected"

"Error: Pool is closed."

Is there any way i could connect them? I tried google for any other solutions but can't find any

Untitled

kolban-google commented 4 years ago

Hello my friend. Off the top of my head I do not know the answer ... HOWEVER ... since I'm currently a fan-boy of Node-RED running on GCP I'm going to look into this immediately. Please expect a response from me in a couple of days. I need to finish what I'm doing right now but after that, I'll start studying and post back here. If I need, I may come back with additional questions (if needed).

Neil

kolban-google commented 4 years ago

In your flow, you appear to have a node that is labeled as "Availability flow" that is dark orange in color. Can you share with me via a post to this issue the complete configuration of the that node?

Can you also elaborate on where Node-RED is running? Is it a docker image or a manual install ... if the later, what underlying OS?

I wrote a test and, at least for me, everything seemed to have worked. This means it becomes even more important that I understand your own configuration.

azrulsalki commented 4 years ago

In the availability flow (dark orange), I would need to set a configuration with the connection to the database.

image

Untitled

The node red is running on my VM instances. Here i share the configuration of my vm: 222

Here are the running node-red software on my vm through SSH: image

kolban-google commented 4 years ago

Thanks for the detailed response. Sadly, I'm not seeing anything obvious here. Let's work backwards and see if we can see something different. Last night, I created a MySQL instance on GCP Cloud SQL, created a Node-RED instance on a Compute Engine and then accessed the MySQL database from a Node-RED flow. Here (at a high level) is what I did:

I created a GCP Cloud SQL instance of type MySQL. I left ALL settings as default. (Did you by any chance check "Allow only SSL connections?).

I then created a Node-RED instance by specifying nodered/node-red as the container image for a GCP Compute Engine. I opened a browser to Node-RED and installed the MySQL. I created a flow with just the MySQL node and configured its settings. I deployed the flow and the node came back and said "connected".

We might have to look at this live together. I'm in the US in central time zone (UTC-6). If you wish, email me at kolban@google.com and we can see if we can't synch up live. Ideally, ping me using Google Chat to kolban@google.com. Best times are after 9:00am US CT. Install hangouts to ping me ... https://chrome.google.com/webstore/detail/google-hangouts/nckgahadagoaajjgafhacjanaoiihapd?hl=en

azrulsalki commented 4 years ago

Oh.. now i know exactly why i cannot connect to the database. I was having the wrong port. previously i was using the 1880 port now i have changed it to 3306 Sorry for the trouble.

Finally: image

Thank you so much : <3

kolban-google commented 4 years ago

Delighted to hear we are now working. Don't hesitate to re-open or create new ones as needed.

kolban-google commented 4 years ago

Delighted to hear we are now working. Don't hesitate to re-open or create new ones as needed.

JulesRosette commented 1 year ago

HI, please,can you can me more about that point cause i'm i nthe sutuation thanks.

"Oh.. now i know exactly why i cannot connect to the database. I was having the wrong port. previously i was using the 1880 port now i have changed it to 3306 Sorry for the trouble."