Monday, January 28, 2019

[google-cloud-sql-discuss] Re: Kubernetes pods can't connect to MySQL

Hello Christophe,


If you get a 'SQLException: Connection refused' then it seems like DB isn't reachable at all. Could you please check if you can reach out to the IP from your pods? Also please provide the screenshot of the error attached with this post removing all sensitive information.


I have found this documentation which explains how to connect to Cloud SQL from External Applications. I would recommend to check this and try to establish a connection from your java application using the instructions.


[1] https://cloud.google.com/sql/docs/mysql/connect-external-app#languages



On Friday, January 18, 2019 at 12:11:49 PM UTC-5, Christophe Deschervois wrote:
HI all,

I am new to  google cloud ( coming from AWS) and I am trying to get my Kubernetes pods(a java app) to  connect  to a mysql instance I have created using a private IP  as it seems to be the easiest/recommended way...  (I was able to connect directly to the DB using the web-console) . but the java app keeps getting connection refused.


I looked at https://cloud.google.com/sql/docs/mysql/private-ip but I was not able to make anything of it. I must say the process is not very clear nor well documented. 

I believe this is a very basic requirement, are there clear steps anywhere on how to accomplish this?

Thanks,
Christophe.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e1312d28-31ab-473a-9ac7-be08c350eb4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment