2

Instead of using a local MySQL instance during Java appengine development, i (sometimes) want to use a real Google Cloud SQL instance (for example; to debug with the real thing).

It is possible to open a JDBC connection from IntelliJ => Databases, but when i'm using this URL in my Maven POM its not working... In this situation i'm already using the appengine driver instead of the local mysql connector.

Why isn't this working? How should i configure my POM? I'm using the following configuration when using the local MySQL instance;

<extraJvmArgs> -Xmx512M -Xms512M -XX:MaxPermSize=128M \ -Dappengine.user.timezone.impl=UTC \ -Drdbms.server=local \ -Drdbms.driver=com.mysql.jdbc.Driver \ -Drdbms.url=jdbc:mysql://localhost:3306/mydb?user=root </extraJvmArgs> 

And my non working Google Cloud SQL instance attempts;

<extraJvmArgs> -Xmx512M -Xms512M -XX:MaxPermSize=128M \ -Dappengine.user.timezone.impl=UTC \ -Drdbms.server=local \ -Drdbms.driver=com.mysql.jdbc.Driver \ -Drdbms.url=jdbc:google:rdbms://domain.com:myportal:myportal/mydb?user=root </extraJvmArgs> 

or

<extraJvmArgs> -Xmx512M -Xms512M -XX:MaxPermSize=128M \ -Dappengine.user.timezone.impl=UTC \ -Drdbms.server=local \ -Drdbms.driver=com.google.appengine.api.rdbms.dev.LocalRdbmsServiceLocalDriver \ -Drdbms.url=jdbc:google:rdbms://domain.com:myportal:myportal/mydb?user=root </extraJvmArgs> 

All my (remote) attempts result in a connection timeout...

1 Answer 1

1

The 'jdbc:google:rdbms' way to connect is deprecated and the preferred way to connect to Cloud SQL from an external application is to use the IP connectivity via the 'jdbc:mysql' (docs).

Sign up to request clarification or add additional context in comments.

4 Comments

Hello Razvan, this works! Thanks!I'm closely following the Cloud SQL developments but missed this one...For completeness this is the working solution; <extraJvmArgs> -Xmx512M -Xms512M -XX:MaxPermSize=128M \ -Dappengine.user.timezone.impl=UTC \ -Drdbms.server=local \ -Drdbms.driver=com.mysql.jdbc.Driver \ -Drdbms.url=jdbc:mysql://XXX.XXX.XXX.XXX:3306/mydbdb?user=USER&amp;password=PASSWORD </extraJvmArgs> This works, but the jdbc database connection is very very slowwww while the native connection to MySQL Workbench is working at normal speed... has anyone else this experience?
Are you still using the 'jdbc:google:rdbms' in your code? If you do then you are still using a slow path. The 'jdbc:mysql' should provide similar speeds with MySQL Workbench.
No i'm now using 'jdbc:mysql' but the performance is very very very bad... (sometimes 20 sec for a query)
That's not the expected behavior. Can you reproduce this problem with a small example? Something along the lines of Google Cloud SQL/App Engine native JBDC demo?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.