Sebagian atau seluruh informasi di halaman ini mungkin tidak berlaku untuk Trusted Cloud dari S3NS. Lihat Perbedaan dari Google Cloud untuk mengetahui detail selengkapnya.
INSTANCE_NAME: nama instance yang ingin Anda aktifkan dukungan penyematan vektornya.
FLAGS: mengonfigurasi flag MySQL berikut di instance Anda:
cloudsql_vector: tetapkan tanda ini ke on untuk mengaktifkan dukungan penyimpanan
embedding vektor dan penelusuran kesamaan vektor. Flag ini dinonaktifkan secara
default. Saat Anda mengonfigurasi tanda, perintah Anda akan terlihat seperti
berikut:
Flag cloudsql_vector bersifat statis. Setelah Anda memperbarui instance dengan
flag (dengan mengaktifkan atau menonaktifkannya), instance Anda akan dimulai ulang secara otomatis
agar perubahan konfigurasi diterapkan.
Untuk mengetahui informasi selengkapnya tentang cara mengonfigurasi flag database untuk MySQL, lihat
Mengonfigurasi flag database.
Menonaktifkan embedding vektor
Sebelum menonaktifkan penyematan vektor di instance, Anda harus
menghapus semua indeks vektor di instance secara eksplisit. Untuk mempelajari cara menemukan daftar
indeks vektor pada instance, lihat
Memantau indeks vektor.
Menonaktifkan dukungan sematan vektor akan mencegah Anda membuat kolom sematan vektor dan indeks vektor baru. Kebijakan ini juga mencegah Anda menggunakan fungsi
approx_distance untuk penelusuran vektor. Untuk menonaktifkan dukungan untuk penyematan vektor, setel tanda cloudsql_vector ke off. Setelah Anda mengonfigurasi flag statis ini, instance akan dimulai ulang secara otomatis agar perubahan konfigurasi diterapkan.
Untuk menonaktifkan dukungan untuk embedding vektor, setel tanda cloudsql_vector ke
off.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-03 UTC."],[],[],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)."]]