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,
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With