Trying to setup connection to Clond SQL 2nd Generation for a Java Appengine with Managed VM.
What I got:
- VM is using Appengine Compat mode (
FROM gcr.io/google_appengine/java-compat
) - I see a MySQL pipe on the host (SSHed, I can see
/cloudsql/**
socket), but default MySQL Java driver doesnt support unix sockets - Google Driver seems to be unsupported on Managed VM (
java.lang.ClassNotFoundException: com.mysql.jdbc.GoogleDriver
) - and I cannot connect to MySQL by IP
- w/o driver it's
No suitable driver found
forjdbc:google:mysql://__IP__:3306/__db__
- or timeout for
jdbc:mysql://__IP__:3306/__db__
(I've added MVM external IP to authorized networks on MySQL) - but what interesting, I can connect to this port from MVM machine, at least port is opened. Anyway, I don't like idea of connecting through publicly open IP:PORT. MVM have a new IP each time, so I even can't add a Firewall rule to specify access from my project only
- w/o driver it's
How I should configure ManagedVM app to connect to Cloud SQL?