[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-19 (世界標準時間)。"],[],[],null,["# Enable and disable vector embeddings on your instance\n\n\u003cbr /\u003e\n\nMySQL \\| PostgreSQL \\| SQL Server\n\n\u003cbr /\u003e\n\n| To use the GA version of vector search, the instance maintenance version should be version `MYSQL_8_0_version.R20241208.01_00` or newer, where version is the minor version number. For information about how to upgrade your instance to a newer version that supports GA vector embeddings, see [Self-service maintenance](/sql/docs/mysql/self-service-maintenance). \n|\n| For information about the syntax and behavior of vector embeddings for the Public Preview version of this feature, see [Work with vector embeddings (Preview)](/sql/docs/mysql/work-with-vectors-preview).\n\nThis section describes how to configure your Cloud SQL instance to\nsupport the storage, indexing, and querying of vector embeddings.\n\nBoth Cloud SQL Enterprise edition and Cloud SQL\nEnterprise Plus edition instances support vector embeddings. All versions of\nMySQL 8.0.36+ are supported.\n\nBefore you begin\n----------------\n\nMake sure you have the Cloud SQL Admin and Compute Viewer roles on\nyour user account.\n\nFor more information, see\n[Roles and permissions](/sql/docs/mysql/roles-and-permissions).\n\nEnable the database flag for vector embeddings\n----------------------------------------------\n\nTo turn on support for vector embeddings, you must enable the MySQL database\nflags. \n\n gcloud sql instances patch \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e \\\n --database-flags=\u003cvar translate=\"no\"\u003eFLAGS\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e: the name of the instance you want to enable vector embedding support on.\n- \u003cvar translate=\"no\"\u003eFLAGS\u003c/var\u003e: configure the following MySQL flag on your instance:\n\n - `cloudsql_vector`: set this flag to `on` to enable vector embedding\n storage and vector similarity search support. This flag is off by\n default. When you configure the flag, your command looks similar to the\n following:\n\n gcloud sql instances patch my-instance \\\n --database-flags=cloudsql_vector=on\n\n The `cloudsql_vector` flag is static. After you update the instance with\n the flag (by turning it on or off), your instance restarts automatically\n in order for the configuration changes to take effect.\n\nFor more information about how to configure database flags for MySQL, see\n[Configure database flags](/sql/docs/mysql/flags).\n\nDisable vector embeddings\n-------------------------\n\nBefore you disable vector embeddings on your instance, you must\nexplicitly drop all vector indexes on the instance. To learn how to find a list\nof vector indexes on the instance, see\n[Monitor vector indexes](/sql/docs/mysql/create-manage-vector-indexes#monitor_vector_indexes).\n\nDisabling vector embeddings support prevents you from creating new vector\nembedding columns and vector indexes. It also prevents you from using the\n`approx_distance` function for vector searches. To turn off support for vector\nembeddings, set the `cloudsql_vector` flag to `off`. After you configure this\nstatic flag, the instance restarts automatically for the configuration change to\ntake effect.\n\nTo disable support for vector embeddings, set the `cloudsql_vector` flag to\n`off`.\n\nFor example: \n\n gcloud sql instances patch \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e \\\n --database-flags=cloudsql_vector=off\n\nReplace \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e with the name of the instance on which you're\nturning off vector embedding support.\n\nWhat's next\n-----------\n\n- Read the [overview about vector search on Cloud SQL](/sql/docs/mysql/vector-search).\n- Learn how to [generate vector embeddings](/sql/docs/mysql/generate-manage-vector-embeddings#generate_vector_embeddings_based_on_row_data).\n- Learn how to [create vector indexes](/sql/docs/mysql/create-manage-vector-indexes).\n- Learn how to [perform searches on vector embeddings](/sql/docs/mysql/search-filter-vector-embeddings)."]]