4
votes

I am new to programming and Google service. I have read this document and set up Cloud SQL access by IP address.

However for access from Python, the documentation is only for App Engine and using Proxy instead. How can I access from Python in Google Compute Engine? Thanks

1
Did you check this and this?amport
@Mangu I have read that document. So My python script on Compute Engine should use proxy to access SQL Cloud?dinex
If your Cloud SQL instance is Second Gen, yes. There is an example in that very same page for both configuring the Proxy and connecting from your Compute instance to your Cloud SQL instance via the proxy.amport

1 Answers

1
votes

Credit @Mangu

Depending upon the application and the requirements, you can configure to connect to the Cloud SQL from python in compute engine using external IP of the Cloud SQL instances or use Cloud SQL Proxy with python (The Cloud SQL Proxy is available only for Second Generation instances.)

Here is another complete example tutorial of using Cloud SQL with Python Bookshelf application.