0

A good while ago I setup access to my Google Cloud SQL Instance on a Windows Server using the cloudsqlproxy method/mechanism.

At one point I set things up adding a cloudsqlproxy user, with a username value and then for hostname the value "cloudsqlproxy~1.2.3.4" etc.

And while this user still exists in my Cloud SQL Users settings/listing, for some reason it will not allow me to add a new user with the same hostname type for the cloudsqlproxy access.

When I try to add "cloudsqlproxy~1.2.3.4" as the hostname for the new user the GCP interface complains: "Must be a domain name, an IP address, an IP address range, or 'localhost'. % may be used as a wildcard."

Clearly it allowed this at one point...has adding users this way for cloudsqlproxy usage been deprecated? Or is it only supported to add cloudsqlproxy users in this fashion via MySQL CLI session?

Many thanks for any feedback.

enter image description here

enter image description here

1

I opened an issue with the Console UI team for Cloud SQL to look into why you can't add the cloudsqlproxy this way. You can follow the public issue here.

You can use the gcloud sql create users command to create the user in the meanwhile either with the wildcard or by specifying the IP.

gcloud sql users create [USERNAME] --instance=[INSTANCE_NAME] --host=cloudsqlproxy~% --password [PASSWORD] 

example:

gcloud sql users create cloudsqlproxy --instance=test-db-2020 --host=cloudsqlproxy~% --password test1234

OR

gcloud sql users create [USERNAME] --instance=[INSTANCE_NAME] --host=cloudsqlproxy~[IP_ADDRESS] --password [PASSWORD] 

example:

gcloud sql users create cloudsqlproxy --instance=test-db-2020 --host=cloudsqlproxy~1.2.3.4 --password test1234

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.