Enable and disable vector embeddings on your instance

MySQL  |  PostgreSQL  |  SQL Server

To use the GA version of vector search, the instance maintenance version shouldbe versionMYSQL_8_0_version.R20241208.01_00 or newer, whereversion is the minor version number. For information about how to upgrade yourinstance to a newer version that supports GA vector embeddings, seeSelf-service maintenance.

For information about the syntax and behavior of vector embeddings for thePublic Preview version of this feature, seeWork with vector embeddings (Preview).

This section describes how to configure your Cloud SQL instance tosupport the storage, indexing, and querying of vector embeddings.

Both Cloud SQL Enterprise edition and Cloud SQLEnterprise Plus edition instances support vector embeddings. All versions ofMySQL 8.0.36+ are supported.

Before you begin

Make sure you have the Cloud SQL Admin and Compute Viewer roles onyour user account.

For more information, seeRoles and permissions.

Enable the database flag for vector embeddings

To turn on support for vector embeddings, you must enable the MySQL databaseflags.

gcloud sql instances patchINSTANCE_NAME \ --database-flags=FLAGS

Replace the following:

  • INSTANCE_NAME: the name of the instance you want to enable vectorembedding support on.
  • FLAGS: configure the following MySQL flag on your instance:

    • cloudsql_vector: set this flag toon to enable vector embeddingstorage and vector similarity search support. This flag is off bydefault. When you configure the flag, your command looks similar to thefollowing:

      gcloud sql instances patch my-instance \--database-flags=cloudsql_vector=on

      Thecloudsql_vector flag is static. After you update the instance withthe flag (by turning it on or off), your instance restarts automaticallyin order for the configuration changes to take effect.

For more information about how to configure database flags for MySQL, seeConfigure database flags.

Disable vector embeddings

Before you disable vector embeddings on your instance, you mustexplicitly drop all vector indexes on the instance. To learn how to find a listof vector indexes on the instance, seeMonitor vector indexes.

Disabling vector embeddings support prevents you from creating new vectorembedding columns and vector indexes. It also prevents you from using theapprox_distance function for vector searches. To turn off support for vectorembeddings, set thecloudsql_vector flag tooff. After you configure thisstatic flag, the instance restarts automatically for the configuration change totake effect.

To disable support for vector embeddings, set thecloudsql_vector flag tooff.

For example:

gcloud sql instances patchINSTANCE_NAME \ --database-flags=cloudsql_vector=off

ReplaceINSTANCE_NAME with the name of the instance on which you'returning off vector embedding support.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.