How do I add proxy and authorization to access Cloud SQL db from my PC

269 views
Skip to first unread message

Vinod Babu

unread,
Apr 17, 2016, 1:26:03 AM4/17/16
to Google Cloud SQL discuss
Hello,
I am a newbee on cloud sql - please help me. 
I have created a mySql 2nd Generation database on google cloud. I am able to access it from my PC, add/remove tables etc after I add my IP address (from whatismy ip search on google) in the authorized IP address list. But my IP address keeps changing everyday and I have to keep updating the IP address. 
I read that it is possible to fix this by creating a proxy in the Google Compute Engine. With my inexperience I could not follow the instructions on the google website.
Can someone help me to create a proxy on Google Compute engine, so that my PC gets authorized even if the IP address changes? 

Thank you very much..

Kamran (Google Cloud Support)

unread,
Apr 17, 2016, 2:38:22 PM4/17/16
to Google Cloud SQL discuss

Hello Babu,

You can use Cloud SQL Proxy. The Cloud SQL Proxy is useful when connecting from clients with dynamic IP addresses. Please visit this article for more information about Google Cloud SQL Proxy and installation instructions. However, please note that this is a Beta release.

Sincerely,

Kamran

Kevin Malachowski

unread,
Apr 18, 2016, 11:40:45 AM4/18/16
to Google Cloud SQL discuss
To be explicit: you can run the Cloud SQL Proxy directly from your PC. No need to use a Compute Engine VM! Please feel free to post back if you are having trouble setting up the Proxy, we'll be glad to help out.

In general, there are three major steps:
1) Download the proxy: on the page previously linked, you can download a precompiled version for your OS/CPU combination of your system.
2) Run the proxy: there are a few examples at the bottom of the page on how to start running the proxy
3) Connect to the proxy: depending on what flag options you passed to the proxy when starting it, you will need to configure your application (mysql command line, for example) to connect via TCP or UNIX socket.

If you have gcloud installed and have run `gcloud auth login`, the latest version of the proxy will just use those credentials when accessing Cloud SQL Databases.

Vinod Babu

unread,
Apr 19, 2016, 2:12:13 AM4/19/16
to Google Cloud SQL discuss
That seems to be an excellent option and thank you for suggesting. That way I don't have to use the VM only for proxy. 
I will follow the steps mentioned and try to set it up.

Regards

Vinod Babu

unread,
Apr 23, 2016, 12:29:45 AM4/23/16
to Google Cloud SQL discuss
Thank you,
I was able to follow the steps and it works for me with cloud proxy installed on my local windows 8 machine. Now I access the db using cloud_sql_proxy_x64.exe..

Thanks again
Babu
Reply all
Reply to author
Forward
0 new messages