简体   繁体   English

如何更改 Google Cloud SQL(第二代)实例的数据库版本?

[英]How to change database version of a Google Cloud SQL (Second Gen) instance?

I have a large Google Cloud SQL (Second Gen) instance, and I would like to upgrade my database version from MySQL 5.6 to 5.7.我有一个大型 Google Cloud SQL(第二代)实例,我想将我的数据库版本从 MySQL 5.6 升级到 5.7。 But database version option is disabled on the edit instance form.但是database version选项在编辑实例表单上被禁用。

Why it is disabled, do i have to create a new instance then export and import existing database?为什么它被禁用,我是否必须创建一个新实例然后导出和导入现有数据库? My database is too large, and it will be a long downtime.我的数据库太大了,停机时间会很长。

Minor version upgrades to MySQL through Google Cloud now appears to be supported, though only through API calls: https://cloud.google.com/sql/docs/mysql/upgrade-minor-db-version#gcloud现在似乎支持通过 Google Cloud 将次要版本升级到 MySQL,但只能通过 API 调用: https://cloud.google.com/sql/docs/mysql/upgrade-minor-db-version#gcloud

The pertinent section if using the gcloud CLI:如果使用gcloud CLI,则相关部分:

gcloud sql instances patch $INSTANCE_NAME --database-version=$DATABASE_VERSION

Substitute your instance name for the $INSTANCE_NAME variable, and your target database version in place of $DATABASE_VERSION .$INSTANCE_NAME变量替换为您的实例名称,并将目标数据库版本替换为$DATABASE_VERSION

There appear to be two REST APIs also available - see the documentation for details.似乎还有两个 REST API 也可用 - 有关详细信息,请参阅文档。

Per the Cloud SQL Migration docs , the only way to migrate versions is to export your data, and re-import into a new instance. 根据Cloud SQL Migration docs ,迁移版本的唯一方法是导出数据,然后重新导入到新实例中。 The documentation mentions going from 5.5 to 5.6, but I would believe that going 5.6 to 5.7 would follow the same procedure. 文档中提到从5.5到5.6,但是我相信从5.6到5.7将遵循相同的过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM