1

I connect to a Google Cloud MySQL DB from my laptop, however my IP address not only changes at home, but also when I travel. I have to specify the allowed public ip address in Google Cloud, but every time I reconnect I have to log in & update google cloud with my new IP address.

What is the best solution to not have to do that?

Serhii Rohoza
  • 4,287
  • 2
  • 16
  • 29
Jaco
  • 51
  • 3
  • 3
    You can solve this issue by using [Cloud SQL Auth proxy](https://cloud.google.com/sql/docs/mysql/sql-proxy) "The Cloud SQL Auth proxy provides secure access to your instances without the need for Authorized networks or for configuring SSL.". Please let me now if it answers your question. – Serhii Rohoza Jul 03 '21 at 08:23
  • 1
    @SerhiiRohoza, it's the best solution. Please add that as answer, it's the right path! – guillaume blaquiere Jul 03 '21 at 16:34

1 Answers1

3

To solve this issue you should use Cloud SQL Auth proxy:

The Cloud SQL Auth proxy provides secure access to your instances without the need for Authorized networks or for configuring SSL.

You can find more details how it works at the documentation:

The Cloud SQL Auth proxy works by having a local client running in the local environment. Your application communicates with the Cloud SQL Auth proxy with the standard database protocol used by your database. The Cloud SQL Auth proxy uses a secure tunnel to communicate with its companion process running on the server.

While the Cloud SQL Auth proxy can listen on any port, it only creates outgoing connections to your Cloud SQL instance on port 3307. If your client machine has an outbound firewall policy, make sure it allows outgoing connections to port 3307 on your Cloud SQL instance's IP.

Serhii Rohoza
  • 4,287
  • 2
  • 16
  • 29