Wednesday, October 12, 2016

[google-cloud-sql-discuss] Setting root password via API

Hi,

I'm programatically creating SQL v2 instances+databases via Google Deployment Manager and wants to set root password via API (it can't be set via deployment manager) but can't figure out how to do it. It appears as it did exist a "InstanceSetRootPasswordRequest" in sqladmin_v1beta3 but this was removed in beta4. Is it possible to set root password via API? 

An admin daemon is responsible for creating the SQL instances across multiple projects which makes it almost impossible[1] to use the gcloud command and I really don't want to do it manually for each instance (there will be quite a few). 

I've (perhaps naively) assumed that I can't access the root user until I set a password but haven't had the time yet to test this. Worst case it's possible and I'll use the mysql client to change root password (if this is allowed). 

Any ideas? :)

Thank you!

Regards,
Niklas

[1] This would require me to programatically open a shell, write the json key contents (current held in memory) to a temporary file, run gcloud auth and then run gcloud ... set-root-password and pray that no other command will run gcloud auth between this request doing it and it running set-root-password

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/64df034c-bec0-4b5d-922d-c4c79bfc5d45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment