Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On Idea Intellij, how to connect to Google Cloud SQL

I try to use the Intellij for develop an Google App Engine application with Google Cloud SQL. How to configure the Cloud Sql access in the developpement launch ?

I add this in the VM options :

-Drdbms.server=hosted -Drdbms.hosted.instance=my-sql-project-id:test
-Drdbms.database=database -Drdbms.driver=com.google.cloud.sql.jdbc.Driver

But the Google Sql must be connected to the server via the oauth2 token.

With the Eclipse Google Plugin, the plugin connect to the database and automatically configure the connection.

Thanks,

like image 410
Patrice De Saint Steban Avatar asked Dec 05 '14 10:12

Patrice De Saint Steban


People also ask

How do I connect Google Cloud to SQL?

In the Google Cloud console, go to the Cloud SQL Instances page. To open the Overview page of an instance, click the instance name. Select Connections from the SQL navigation menu. In the Authorized networks section, click Add network and enter the IP address of the machine where the client is installed.

How do I connect to a SQL Cloud proxy?

Start the Cloud SQL Auth proxyReplace INSTANCE_CONNECTION_NAME with the instance connection name you copied in the previous step. At the Enter password: prompt, enter the password of your MySQL root user account. Verify that the MySQL prompt appears. You have connected to your database using the mysql client.

How do I connect to GCP?

Connect through a browser from the GCP MarketplaceBrowse to the Google Cloud Platform console and sign in if required using your Google account. Find and select your project in the project list. Select the “Compute -> Compute Engine” menu item. Locate your server instance and select the SSH button.


1 Answers

The recommended way currently to connect from dev_appserver to Cloud SQL is using the external IP connectivity.

Reference: https://cloud.google.com/sql/docs/access-control#appaccess

like image 81
Razvan Musaloiu-E. Avatar answered Sep 30 '22 21:09

Razvan Musaloiu-E.