Score:0

Connecting to Google Cloud MySql DB with a changing IP address

au flag

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?

Michael Hampton avatar
cz flag
Not connecting to the DB from your laptop, of course. A VPN, if you really can't avoid it (but you really can avoid it most of the time).
John Hanley avatar
cn flag
Use the Google Cloud SQL Auth Proxy. Very easy to run on your laptop/desktop. Unless you are using SSL when you connect via IP address, your authentication credentials are sent across the Internet in the clear. Since you mention travel, I recommend that you set up a VPN as well.
Score:1
sb flag

To add to what Michael said, if you absolutely must connect from your laptop (again, this by itself sounds like a big part of the issue to start with), you can look into

  • using Cloud SQL proxy [1]
  • securing your connection to the DB with a certificate [2]

[1] https://cloud.google.com/sql/docs/mysql/sql-proxy
[2] https://cloud.google.com/sql/docs/mysql/authorize-ssl

Score:0
US flag
user1019066

Since you connect to the Cloud SQL instance via internet I assume the instance has a public IP. If so, you can use the gcloud sql connect command.

Ref. https://cloud.google.com/sdk/gcloud/reference/sql/connect

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.