Change server collation to `utf8_unicode_ci` in Google Cloud SQL

google-cloud-platform

I have a Google Cloud SQL instance with a default server collation of utf8_general_ci. I'd like to change this to utf8_unicode_ci. How can I do this?

Before, I could go to the "old" Google Cloud SQL console and run SQL as a super-admin; I thought I could make the change this way. However, I don't see this link anywhere in the new console, and when running SQL remotely (even as root), I cannot perform super-admin changes.

I've also looked at configuring MySQL flags, but only the character set is available for modification (character_set_server), not the collation.

Is there a way I can change the default server collation to utf8_unicode_ci in a Google Cloud SQL instance?

Best Answer

Use Google Cloud SQL API to change the collation value of your GCS databases. In this case, use patch method as you want to do a partial update of the databases settings. You can do this through APIs Explorer Try it!.

Related Topic