Friday, September 30, 2016

Re: [google-cloud-sql-discuss] Anyway to disable only_full_group_by on 5.7

We added the sql_mode = TRADITIONAL to the mysql_flags section to get around this.

http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_traditional


On Wednesday, August 3, 2016 at 12:26:51 PM UTC-5, David Newgas wrote:
By default Cloud SQL leaves the sql mode at the default, which includes strict_trans_tables in 5.7 but does not in 5.5 or 5.6.  So if you are running 5.5 or 5.6 it is already off by default.

If you are running 5.7 you can turn it off globally by setting the sql_mode flag to anything else, or blank. Because of the issue outlined earlier in this thread, this will remove some of the other modes too. The only way to remove just that one flag is to set the sql_mode session variable each time you connect as outlined earlier.

David

On Wed, Aug 3, 2016 at 10:19 AM, Hajar Homayouni <homayou...@gmail.com> wrote:
Hi,
How can I disable Strict mode in Cloud sql?


On Friday, June 3, 2016 at 10:34:35 AM UTC-6, David Newgas wrote:
Hi,

ONLY_FULL_GROUP_BY isn't actually a database flag, it is one of the possible parameters of the sql_mode database flag. sql_mode is one of the supported flags in Cloud SQL, which means you can change it by editing the instance properties. In order to remove ONLY_FULL_GROUP_BY but leave the other default modes you would need to set sql_mode to STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE(etc). Unfortunately it seems that our validation only allows you to set one mode. This is a bug, which I am reporting now.

In the mean time the best workaround is to use SET SESSION sql_mode='...' at the start of each session to remove the mode.

David

On Fri, Jun 3, 2016 at 6:29 AM, Matt Bourne <matt...@gmail.com> wrote:
It seems like there is no super access and although you can add flags there appears no way to remove default flags like only_full_group_by

--
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/b977f133-5127-4a54-9fa6-cdc7be6ac465%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/40ef3feb-bd42-4030-bf3c-f3475b2f9d95%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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/79c8f7b4-8363-4b3f-9e6a-df51df63715d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] I am able to login using sqlworkbench however unable to login using sql management studio.

I am able to login using sqlworkbench however unable to login using sql management studio. Also wanted to use the google sql in WordPress config but it's not connecting.

can anybody help me out in this regard?

--
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/352bea1c-9f40-4871-9eb8-6ea142dbdd12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: Errors when importing gen 1 v5.6 into gen 2 v5.6

Hey Rob,

Thanks for reporting this. I've been able to replicate the behaviour and I've created a Public Issue Tracker thread for this. You should star that issue to receive updates. We'll post further updates there. In general, if you find a platform issue like this, that's the place to post in future. Thanks again!

Cheers,

Nick
Cloud Platform Community Support

On Sunday, September 25, 2016 at 2:54:35 PM UTC-4, Rob wrote:
Without setting log-bin-trust-function-creators this is the error I get:

ERROR 1227 (42000) at line 156: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

I'm pretty sure this is due to a DEFINER clause on a CREATE TRIGGER statement.

However, this *is* something that needs to be able to happen on an import. Changing the dump file is not a solution as the permissions do need to be set.

How can I work around this? Is this a bug that will be fixed?

--
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/a5b4a3be-c151-43a0-9a79-2b478837136c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Monday, September 26, 2016

[google-cloud-sql-discuss] Re: Can no longer connect to 1st get instance over TLS?

Take a look at the recent operations on your instance. Has someone Reset the SSL certificates on the server or disabled SSL entirely?

On Monday, September 26, 2016 at 1:00:56 AM UTC-7, da...@theclickadvisor.com wrote:
Whenever I try to connect to my 1st gen instance over TLS, I now get the following error message:

SSL connection error: SSL is required but the server doesn't support it

This was working fine until this weekend?


--
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/f8c92fbc-87cb-4267-824a-1e3c566cee80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Can no longer connect to 1st get instance over TLS?

Whenever I try to connect to my 1st gen instance over TLS, I now get the following error message:

SSL connection error: SSL is required but the server doesn't support it

This was working fine until this weekend?


--
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/4fe37738-aa4e-4f43-8188-7cc103931f54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sunday, September 25, 2016

[google-cloud-sql-discuss] Re: Errors when importing gen 1 v5.6 into gen 2 v5.6

Without setting log-bin-trust-function-creators this is the error I get:

ERROR 1227 (42000) at line 156: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

I'm pretty sure this is due to a DEFINER clause on a CREATE TRIGGER statement.

However, this *is* something that needs to be able to happen on an import. Changing the dump file is not a solution as the permissions do need to be set.

How can I work around this? Is this a bug that will be fixed?

--
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/da626c00-6e9d-4cf7-9f7a-78041923b2cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Errors when importing gen 1 v5.6 into gen 2 v5.6


ERROR 1227 (42000) at line 156: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

Even after setting log-bin-trust-function-creators I still cannot import a simple dump from gen 1 to gen 2. Both v5.6.

How to reproduce:
  1. create a db on gen 1 v5.6 with a simple trigger on a table.
  2. export the gen 1 database to file X
  3. import file X into gen 2 v5.6 (o v5.7, I tried both) with and without log-bin-trust-function-creators - errors out with above message.
Note that you can import and export this file all day long without errors in gen 1.

All operations performed from the browser.

Any ideas on how to get around this?

--
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/53a1fd2a-6743-45d0-93a2-77243adb1d99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saturday, September 24, 2016

Re: [google-cloud-sql-discuss] A GCE instance connecting to two (or more) Cloud SQL databases via multiple cloud-sql-proxy-instances?

On Sunday, 25 September 2016 00:54:56 UTC+5:30, Vadim Berezniker wrote:
You don't need to run multiple instances of the proxy. You can specify multiple instances in the instances parameter (comma separated).

Thanks again, Vadim. Tried the same and ran into no issues. 


On Sat, Sep 24, 2016 at 10:25 AM Roshan Dawrani <roshan...@gmail.com> wrote:
Hi,

My app on a GCE instance needs to connect to two Cloud SQL databases.

Can I run two instances of cloud_sql_proxy and point use different "local port + cloud instance name" combinations for them?

I gave it a quick try and was able to put data in both the DBs through different port-based proxies, but I just want to be sure that it's something that's officially supported and expected to cleanly work.

Could someone please confirm?

Thanks,
Roshan

--
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/e67be789-a6a9-4bed-b487-e3ed9470cf2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/81ec4ff9-29ed-4f0e-964f-005fb33624c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: [google-cloud-sql-discuss] A GCE instance connecting to two (or more) Cloud SQL databases via multiple cloud-sql-proxy-instances?

You don't need to run multiple instances of the proxy. You can specify multiple instances in the instances parameter (comma separated).

On Sat, Sep 24, 2016 at 10:25 AM Roshan Dawrani <roshandawrani@gmail.com> wrote:
Hi,

My app on a GCE instance needs to connect to two Cloud SQL databases.

Can I run two instances of cloud_sql_proxy and point use different "local port + cloud instance name" combinations for them?

I gave it a quick try and was able to put data in both the DBs through different port-based proxies, but I just want to be sure that it's something that's officially supported and expected to cleanly work.

Could someone please confirm?

Thanks,
Roshan

--
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/e67be789-a6a9-4bed-b487-e3ed9470cf2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CABDU3p01ut8bccN8mV3%2B54vB-ofanLOtiK83ORcYebcaf3QnHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] A GCE instance connecting to two (or more) Cloud SQL databases via multiple cloud-sql-proxy-instances?

Hi,

My app on a GCE instance needs to connect to two Cloud SQL databases.

Can I run two instances of cloud_sql_proxy and point use different "local port + cloud instance name" combinations for them?

I gave it a quick try and was able to put data in both the DBs through different port-based proxies, but I just want to be sure that it's something that's officially supported and expected to cleanly work.

Could someone please confirm?

Thanks,
Roshan

--
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/e67be789-a6a9-4bed-b487-e3ed9470cf2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thursday, September 22, 2016

Re: [google-cloud-sql-discuss] How to connect from a pool of compute engine instances to Cloud SQL DB in the same project?

Hi Vadim,

I tried putting back "cloud-sql-mysql-socket-factory" again just now, and didn't run into any issues this time. I must have made a mistake last time I tried it.

I just had to additionally introduce the socket factory's dependency "google-api-services-sqladmin" jar and then it was fine.

So, finally I used mysql-connector-java-5.1.39-bin.jar, mysql-socket-factory-1.0.1.jar, above-mentioned google-api-services-sqladmin-v1beta4-rev29-1.22.0.jar jar, and the following test JDBC URL:

"jdbc:mysql://google/___my_db_name___?cloudSqlInstance=___my_cloud_db_conn_name_like_foo:bar:baz___&socketFactory=com.google.cloud.sql.mysql.SocketFactory&user=___my_db_user___&password=___my_db_user___"

Thanks for your time on helping on this.

Cheers,
Roshan

On Thursday, 22 September 2016 20:18:10 UTC+5:30, Vadim Berezniker wrote:


On Wed, Sep 21, 2016 at 12:55 PM Roshan Dawrani <roshan...@gmail.com> wrote:
Just gave it a try, but got the following errors:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Caused by: java.net.UnknownHostException: google: unknown error

This error indicates that the custom socket factory is not being used at all.
Can you paste the full stack trace?
What version of the mysql jdbc driver are you using?
I'd like to understand why it didn't work for you.
 

A) My JDBC connection string looked like (as per the library's documentation on GitHub):

"jdbc:mysql://google/__my_db__name?cloudSqlInstance=__my_cloud_sql_instance_connection_name_as_foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory"

Is the format ""jdbc:mysql://google/...." correct for a compute engine environment?

B) I also tried switching ""jdbc:mysql://111.222.111.222/__my_db_name?cloudSqlInstance...." format (where 111.222.111.222 is my Cloud SQL DB instance's IP address), but I still get the errors:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Caused by: java.net.ConnectException: Connection timed out

Am I doing something wrong? Both my compute engine instance and Cloud Sql DB instance are under the same project and compute engine's default service account has an Editor role too.

On Thursday, 22 September 2016 00:51:04 UTC+5:30, Vadim Berezniker wrote:
This uses the regular mysql driver so pass in the credentials in the same way you would for the regular mysql driver (either via the URL or via properties). 
This library only overrides how the connection in established to MySQL.

On Wed, Sep 21, 2016 at 12:18 PM Roshan Dawrani <roshan...@gmail.com> wrote:
Is there any reasonable documentation available for how to use it? I googled and only saw some questions, etc in conjunction with AppEngine Flexible Enviroment.

The github repo README only says that JDBC url should look like "jdbc:mysql://google/mydb?cloudSqlInstance=foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory"

Where do I pass the login credentials for the user I am logging in as to the database server?

On Thursday, 22 September 2016 00:24:50 UTC+5:30, Vadim Berezniker wrote:
On Wed, Sep 21, 2016 at 11:48 AM Roshan Dawrani <roshan...@gmail.com> wrote:
Hi,

If I have a pool of Compute Engine instances (behind a load-balancer with a static IP), and I want to connect from Java apps on these instances to a Cloud Sql database in the same project, what's the way to about it?

1) These instances in the load balancer don't have static external IPs, so I can't authorize access to Cloud SQL by IP addresses.

2) "com.mysql.jdbc.GoogleDriver" is not available on Compute Engine, as it is on App Engine.

3) If I try to use the stock MySql JDBC driver, it doesn't understand a connection string like:

    "jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&amp;password=__password__";

    and fails saying "No suitable driver found for jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&amp;password=__password__"

I can't believe I can't easily connect from Compute Engine instances to a Cloud SQL database of the same Google Cloud project.

Is my only option to use "Connecting using the Cloud SQL Proxy" approach as described on https://cloud.google.com/sql/docs/compute-engine-access? That seems significant amount of work to be done automatically on instances that will come to the pool and go away at will!

Could someone advise please?

Thanks,
Roshan

--
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/dc37088f-5f15-4e10-8c9f-383cca2dece0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/9e5f50ea-0b8f-4595-aeea-7a5f34f9c1f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/2109ff2d-1aaa-4c7d-a625-457f5d0f7658%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/ba91c061-cd54-46da-baa9-5406e096a683%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: [google-cloud-sql-discuss] How to connect from a pool of compute engine instances to Cloud SQL DB in the same project?

I have mysql-connector-java-5.1.39-bin.jar connecting to MySQL 5.7 (Cloud SQL) db.

On Thursday, 22 September 2016 22:01:11 UTC+5:30, Vadim Berezniker wrote:
Thanks Roshan. 
In the meantime, can you tell me what version of the mysql driver you are depending on in your project?

On Thu, Sep 22, 2016 at 9:29 AM Roshan Dawrani <roshan...@gmail.com> wrote:
To return to that error with custom Java socket factory, I'll need to undo some changes my google-cloud-proxy based environment (I linked its setup to start-up scripts of the GCE instance pool members). Also, the GCE + Cloud SQL environment is in heavy, temporary use tonight. So, I'll do the changes to temporarily start using cloud-sql-mysql-socket-factory again tomorrow morning my time (India) and get you the stack trace and other info for analysis.

Cheers.

On Thursday, 22 September 2016 20:18:10 UTC+5:30, Vadim Berezniker wrote:


On Wed, Sep 21, 2016 at 12:55 PM Roshan Dawrani <roshan...@gmail.com> wrote:
Just gave it a try, but got the following errors:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Caused by: java.net.UnknownHostException: google: unknown error

This error indicates that the custom socket factory is not being used at all.
Can you paste the full stack trace?
What version of the mysql jdbc driver are you using?
I'd like to understand why it didn't work for you.
 

A) My JDBC connection string looked like (as per the library's documentation on GitHub):

"jdbc:mysql://google/__my_db__name?cloudSqlInstance=__my_cloud_sql_instance_connection_name_as_foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory"

Is the format ""jdbc:mysql://google/...." correct for a compute engine environment?

B) I also tried switching ""jdbc:mysql://111.222.111.222/__my_db_name?cloudSqlInstance...." format (where 111.222.111.222 is my Cloud SQL DB instance's IP address), but I still get the errors:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Caused by: java.net.ConnectException: Connection timed out

Am I doing something wrong? Both my compute engine instance and Cloud Sql DB instance are under the same project and compute engine's default service account has an Editor role too.

On Thursday, 22 September 2016 00:51:04 UTC+5:30, Vadim Berezniker wrote:
This uses the regular mysql driver so pass in the credentials in the same way you would for the regular mysql driver (either via the URL or via properties). 
This library only overrides how the connection in established to MySQL.

On Wed, Sep 21, 2016 at 12:18 PM Roshan Dawrani <roshan...@gmail.com> wrote:
Is there any reasonable documentation available for how to use it? I googled and only saw some questions, etc in conjunction with AppEngine Flexible Enviroment.

The github repo README only says that JDBC url should look like "jdbc:mysql://google/mydb?cloudSqlInstance=foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory"

Where do I pass the login credentials for the user I am logging in as to the database server?

On Thursday, 22 September 2016 00:24:50 UTC+5:30, Vadim Berezniker wrote:
On Wed, Sep 21, 2016 at 11:48 AM Roshan Dawrani <roshan...@gmail.com> wrote:
Hi,

If I have a pool of Compute Engine instances (behind a load-balancer with a static IP), and I want to connect from Java apps on these instances to a Cloud Sql database in the same project, what's the way to about it?

1) These instances in the load balancer don't have static external IPs, so I can't authorize access to Cloud SQL by IP addresses.

2) "com.mysql.jdbc.GoogleDriver" is not available on Compute Engine, as it is on App Engine.

3) If I try to use the stock MySql JDBC driver, it doesn't understand a connection string like:

    "jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&amp;password=__password__";

    and fails saying "No suitable driver found for jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&amp;password=__password__"

I can't believe I can't easily connect from Compute Engine instances to a Cloud SQL database of the same Google Cloud project.

Is my only option to use "Connecting using the Cloud SQL Proxy" approach as described on https://cloud.google.com/sql/docs/compute-engine-access? That seems significant amount of work to be done automatically on instances that will come to the pool and go away at will!

Could someone advise please?

Thanks,
Roshan

--
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/dc37088f-5f15-4e10-8c9f-383cca2dece0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/9e5f50ea-0b8f-4595-aeea-7a5f34f9c1f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/2109ff2d-1aaa-4c7d-a625-457f5d0f7658%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/0721a994-eeee-4dc4-92fd-4c056db7b941%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/5221b2c8-daee-42f2-abc9-3725fdf87560%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: [google-cloud-sql-discuss] How to connect from a pool of compute engine instances to Cloud SQL DB in the same project?

Thanks Roshan. 
In the meantime, can you tell me what version of the mysql driver you are depending on in your project?

On Thu, Sep 22, 2016 at 9:29 AM Roshan Dawrani <roshandawrani@gmail.com> wrote:
To return to that error with custom Java socket factory, I'll need to undo some changes my google-cloud-proxy based environment (I linked its setup to start-up scripts of the GCE instance pool members). Also, the GCE + Cloud SQL environment is in heavy, temporary use tonight. So, I'll do the changes to temporarily start using cloud-sql-mysql-socket-factory again tomorrow morning my time (India) and get you the stack trace and other info for analysis.

Cheers.

On Thursday, 22 September 2016 20:18:10 UTC+5:30, Vadim Berezniker wrote:


On Wed, Sep 21, 2016 at 12:55 PM Roshan Dawrani <roshan...@gmail.com> wrote:
Just gave it a try, but got the following errors:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Caused by: java.net.UnknownHostException: google: unknown error

This error indicates that the custom socket factory is not being used at all.
Can you paste the full stack trace?
What version of the mysql jdbc driver are you using?
I'd like to understand why it didn't work for you.
 

A) My JDBC connection string looked like (as per the library's documentation on GitHub):

"jdbc:mysql://google/__my_db__name?cloudSqlInstance=__my_cloud_sql_instance_connection_name_as_foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory"

Is the format ""jdbc:mysql://google/...." correct for a compute engine environment?

B) I also tried switching ""jdbc:mysql://111.222.111.222/__my_db_name?cloudSqlInstance...." format (where 111.222.111.222 is my Cloud SQL DB instance's IP address), but I still get the errors:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Caused by: java.net.ConnectException: Connection timed out

Am I doing something wrong? Both my compute engine instance and Cloud Sql DB instance are under the same project and compute engine's default service account has an Editor role too.

On Thursday, 22 September 2016 00:51:04 UTC+5:30, Vadim Berezniker wrote:
This uses the regular mysql driver so pass in the credentials in the same way you would for the regular mysql driver (either via the URL or via properties). 
This library only overrides how the connection in established to MySQL.

On Wed, Sep 21, 2016 at 12:18 PM Roshan Dawrani <roshan...@gmail.com> wrote:
Is there any reasonable documentation available for how to use it? I googled and only saw some questions, etc in conjunction with AppEngine Flexible Enviroment.

The github repo README only says that JDBC url should look like "jdbc:mysql://google/mydb?cloudSqlInstance=foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory"

Where do I pass the login credentials for the user I am logging in as to the database server?

On Thursday, 22 September 2016 00:24:50 UTC+5:30, Vadim Berezniker wrote:
On Wed, Sep 21, 2016 at 11:48 AM Roshan Dawrani <roshan...@gmail.com> wrote:
Hi,

If I have a pool of Compute Engine instances (behind a load-balancer with a static IP), and I want to connect from Java apps on these instances to a Cloud Sql database in the same project, what's the way to about it?

1) These instances in the load balancer don't have static external IPs, so I can't authorize access to Cloud SQL by IP addresses.

2) "com.mysql.jdbc.GoogleDriver" is not available on Compute Engine, as it is on App Engine.

3) If I try to use the stock MySql JDBC driver, it doesn't understand a connection string like:

    "jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&amp;password=__password__";

    and fails saying "No suitable driver found for jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&amp;password=__password__"

I can't believe I can't easily connect from Compute Engine instances to a Cloud SQL database of the same Google Cloud project.

Is my only option to use "Connecting using the Cloud SQL Proxy" approach as described on https://cloud.google.com/sql/docs/compute-engine-access? That seems significant amount of work to be done automatically on instances that will come to the pool and go away at will!

Could someone advise please?

Thanks,
Roshan

--
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/dc37088f-5f15-4e10-8c9f-383cca2dece0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/9e5f50ea-0b8f-4595-aeea-7a5f34f9c1f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/2109ff2d-1aaa-4c7d-a625-457f5d0f7658%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/0721a994-eeee-4dc4-92fd-4c056db7b941%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CABDU3p0Z3RJhHZ%2B0SqDpWYkif6qqEZewBokBuD_zqcAPeJbRUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: [google-cloud-sql-discuss] How to connect from a pool of compute engine instances to Cloud SQL DB in the same project?

To return to that error with custom Java socket factory, I'll need to undo some changes my google-cloud-proxy based environment (I linked its setup to start-up scripts of the GCE instance pool members). Also, the GCE + Cloud SQL environment is in heavy, temporary use tonight. So, I'll do the changes to temporarily start using cloud-sql-mysql-socket-factory again tomorrow morning my time (India) and get you the stack trace and other info for analysis.

Cheers.

On Thursday, 22 September 2016 20:18:10 UTC+5:30, Vadim Berezniker wrote:


On Wed, Sep 21, 2016 at 12:55 PM Roshan Dawrani <roshan...@gmail.com> wrote:
Just gave it a try, but got the following errors:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Caused by: java.net.UnknownHostException: google: unknown error

This error indicates that the custom socket factory is not being used at all.
Can you paste the full stack trace?
What version of the mysql jdbc driver are you using?
I'd like to understand why it didn't work for you.
 

A) My JDBC connection string looked like (as per the library's documentation on GitHub):

"jdbc:mysql://google/__my_db__name?cloudSqlInstance=__my_cloud_sql_instance_connection_name_as_foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory"

Is the format ""jdbc:mysql://google/...." correct for a compute engine environment?

B) I also tried switching ""jdbc:mysql://111.222.111.222/__my_db_name?cloudSqlInstance...." format (where 111.222.111.222 is my Cloud SQL DB instance's IP address), but I still get the errors:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Caused by: java.net.ConnectException: Connection timed out

Am I doing something wrong? Both my compute engine instance and Cloud Sql DB instance are under the same project and compute engine's default service account has an Editor role too.

On Thursday, 22 September 2016 00:51:04 UTC+5:30, Vadim Berezniker wrote:
This uses the regular mysql driver so pass in the credentials in the same way you would for the regular mysql driver (either via the URL or via properties). 
This library only overrides how the connection in established to MySQL.

On Wed, Sep 21, 2016 at 12:18 PM Roshan Dawrani <roshan...@gmail.com> wrote:
Is there any reasonable documentation available for how to use it? I googled and only saw some questions, etc in conjunction with AppEngine Flexible Enviroment.

The github repo README only says that JDBC url should look like "jdbc:mysql://google/mydb?cloudSqlInstance=foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory"

Where do I pass the login credentials for the user I am logging in as to the database server?

On Thursday, 22 September 2016 00:24:50 UTC+5:30, Vadim Berezniker wrote:
On Wed, Sep 21, 2016 at 11:48 AM Roshan Dawrani <roshan...@gmail.com> wrote:
Hi,

If I have a pool of Compute Engine instances (behind a load-balancer with a static IP), and I want to connect from Java apps on these instances to a Cloud Sql database in the same project, what's the way to about it?

1) These instances in the load balancer don't have static external IPs, so I can't authorize access to Cloud SQL by IP addresses.

2) "com.mysql.jdbc.GoogleDriver" is not available on Compute Engine, as it is on App Engine.

3) If I try to use the stock MySql JDBC driver, it doesn't understand a connection string like:

    "jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&amp;password=__password__";

    and fails saying "No suitable driver found for jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&amp;password=__password__"

I can't believe I can't easily connect from Compute Engine instances to a Cloud SQL database of the same Google Cloud project.

Is my only option to use "Connecting using the Cloud SQL Proxy" approach as described on https://cloud.google.com/sql/docs/compute-engine-access? That seems significant amount of work to be done automatically on instances that will come to the pool and go away at will!

Could someone advise please?

Thanks,
Roshan

--
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/dc37088f-5f15-4e10-8c9f-383cca2dece0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/9e5f50ea-0b8f-4595-aeea-7a5f34f9c1f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/2109ff2d-1aaa-4c7d-a625-457f5d0f7658%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/0721a994-eeee-4dc4-92fd-4c056db7b941%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: [google-cloud-sql-discuss] Can't Connect AppEngine project to Could SQL in Eclipse Plugin

I have got it working. The short answer is: use a regular MySQL connection. This is described at https://developers.google.com/eclipse/docs/cloudsql-database. The longer answer:
  1. Install Eclipse Data Tools Platform (http://www.eclipse.org/datatools/downloads.php)
  2. When you create a new Connection Profile, select regular "MySQL" type. (not Google Cloud SQL)
  3. On the Driver/Connection Details page ensure the driver drop down says "MySQL JDBC Driver" and not "Driver (GOOGLE)". If no "MySQL JDBC Driver" option is present, use the "new driver definition" button, you may need to manually specify the path to the MySQL Connector/J JAR.
  4. Use the IP address of your instance in the properties - you will be connecting via regular remote MySQL connection. This will require a whitelisted IP address.
I was then able to connect to my test instance.

On Wed, Sep 21, 2016 at 5:32 PM, David Newgas <dnewgas@google.com> wrote:
I have reproduced the issue. Now I'm just trying to find a solution.

On Wed, Sep 21, 2016 at 3:59 PM, Montassar Dridi <montassar0dridi@gmail.com> wrote:
Yes I already included mysql-connector-java-5.1.39-bin in class path 

On Wednesday, September 21, 2016 at 11:59:30 AM UTC-4, David Newgas wrote:
Based on the ClassNotFound exception in the final error, It sounds like you don't have the MySQL/J Connector installed. Make sure you follow step 4 of https://developers.google.com/eclipse/docs/cloudsql-createapp, and also read the bottom of the "Running your application locally" section of that doc, which deals with that error specifically.



On Tue, Sep 20, 2016 at 4:55 PM, Montassar Dridi <montass...@gmail.com> wrote:
Can anyone help please and tell me what I'm missing ?

--
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/4af8c5cf-c1ee-46db-a4d8-c38da1432dc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/dd782eb7-73d3-4253-876b-c741928fe6a1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
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/CAJZK_bZ39rbgPhBx4L6uGj_aTPPn5n1aRKnfr8%2BwSsfCCceXwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: [google-cloud-sql-discuss] How to connect from a pool of compute engine instances to Cloud SQL DB in the same project?



On Wed, Sep 21, 2016 at 12:55 PM Roshan Dawrani <roshandawrani@gmail.com> wrote:
Just gave it a try, but got the following errors:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Caused by: java.net.UnknownHostException: google: unknown error

This error indicates that the custom socket factory is not being used at all.
Can you paste the full stack trace?
What version of the mysql jdbc driver are you using?
I'd like to understand why it didn't work for you.
 

A) My JDBC connection string looked like (as per the library's documentation on GitHub):

"jdbc:mysql://google/__my_db__name?cloudSqlInstance=__my_cloud_sql_instance_connection_name_as_foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory"

Is the format ""jdbc:mysql://google/...." correct for a compute engine environment?

B) I also tried switching ""jdbc:mysql://111.222.111.222/__my_db_name?cloudSqlInstance...." format (where 111.222.111.222 is my Cloud SQL DB instance's IP address), but I still get the errors:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Caused by: java.net.ConnectException: Connection timed out

Am I doing something wrong? Both my compute engine instance and Cloud Sql DB instance are under the same project and compute engine's default service account has an Editor role too.

On Thursday, 22 September 2016 00:51:04 UTC+5:30, Vadim Berezniker wrote:
This uses the regular mysql driver so pass in the credentials in the same way you would for the regular mysql driver (either via the URL or via properties). 
This library only overrides how the connection in established to MySQL.

On Wed, Sep 21, 2016 at 12:18 PM Roshan Dawrani <roshan...@gmail.com> wrote:
Is there any reasonable documentation available for how to use it? I googled and only saw some questions, etc in conjunction with AppEngine Flexible Enviroment.

The github repo README only says that JDBC url should look like "jdbc:mysql://google/mydb?cloudSqlInstance=foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory"

Where do I pass the login credentials for the user I am logging in as to the database server?

On Thursday, 22 September 2016 00:24:50 UTC+5:30, Vadim Berezniker wrote:
On Wed, Sep 21, 2016 at 11:48 AM Roshan Dawrani <roshan...@gmail.com> wrote:
Hi,

If I have a pool of Compute Engine instances (behind a load-balancer with a static IP), and I want to connect from Java apps on these instances to a Cloud Sql database in the same project, what's the way to about it?

1) These instances in the load balancer don't have static external IPs, so I can't authorize access to Cloud SQL by IP addresses.

2) "com.mysql.jdbc.GoogleDriver" is not available on Compute Engine, as it is on App Engine.

3) If I try to use the stock MySql JDBC driver, it doesn't understand a connection string like:

    "jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&amp;password=__password__";

    and fails saying "No suitable driver found for jdbc:google:mysql://__instance_name__/__db_name__>?user=__user__&amp;password=__password__"

I can't believe I can't easily connect from Compute Engine instances to a Cloud SQL database of the same Google Cloud project.

Is my only option to use "Connecting using the Cloud SQL Proxy" approach as described on https://cloud.google.com/sql/docs/compute-engine-access? That seems significant amount of work to be done automatically on instances that will come to the pool and go away at will!

Could someone advise please?

Thanks,
Roshan

--
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/dc37088f-5f15-4e10-8c9f-383cca2dece0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/9e5f50ea-0b8f-4595-aeea-7a5f34f9c1f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/2109ff2d-1aaa-4c7d-a625-457f5d0f7658%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CABDU3p2z3GvGs9kn3%3DFBM3hHZ09JUwAEiuCBU9RBx%2BTg%2BOSCpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.