[英]Using Google Cloud SQL during Java appengine development (instead of local MySQL instance)
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). 我(有时)不希望在Java Appengine开发期间使用本地MySQL实例,而希望使用真实的Google Cloud SQL实例(例如,使用真实的东西进行调试)。
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. 可以从IntelliJ =>数据库打开JDBC连接,但是当我在Maven POM中使用此URL时,它无法正常工作...在这种情况下,我已经在使用appengine驱动程序,而不是本地mysql连接器。
Why isn't this working? 为什么这不起作用? How should i configure my POM? 我应该如何配置我的POM? I'm using the following configuration when using the local MySQL instance; 使用本地MySQL实例时,我使用以下配置;
<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; 和我无法使用的Google Cloud SQL实例尝试;
<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... 我所有的(远程)尝试都导致连接超时...
不建议使用'jdbc:google:rdbms'的连接方式,从外部应用程序连接至Cloud SQL的首选方法是通过'jdbc:mysql'( docs )使用IP连接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.