Sunday, February 7, 2016

Re: [google-cloud-sql-discuss] Can't connect to Google Cloud SQL through PhpStorm - No Refresh Token

Hi,

It looks like PHPStorm is using the legacy com.google.cloud.sql.jdbc.Driver code, which has been deprecated for a long time, and not providing the OAuth2.0 credentials needed to connect with that code. There are a few things you might be able to do to get it to work:
  1. Don't use that driver. Authorize the IP address of your system for your Cloud SQL instance and then connect by IP address using the standard MySQL driver (com.mysql.jdbc.Driver).
  2. Run the code on a Google Compute Engine instance that is configured with permission to access Cloud SQL API. The driver should then automatically use the built in GCE service account.
  3. Provide a OAuth2.0 access token or refresh token as part of the JDBC URL.
Option (1) is really the best as we don't support access with the legacy driver.

David

On Fri, Feb 5, 2016 at 6:12 PM, Zack Hine <zackhine@gmail.com> wrote:


I can connect through the google_sql_tool though.

I get this error when I try to connect







Any ideas? I've run google_sql myInstance mDatabase command with google_sql_tool and I got a authroization code which I'm user in the connection "User" field.

Thanks!

--
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/4c4799b8-02cd-4950-bb7b-35f536fa35a5%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_bbj4%3DEvFCBKFjau%3DYHZC%2B4kQC0Pi%2BTBASjHOZC2dKY%2BmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment