[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-07。"],[],[],null,["# Cloud SQL Language Connectors overview\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/language-connectors \"View this page for the MySQL database engine\") \\| [PostgreSQL](/sql/docs/postgres/language-connectors \"View this page for the PostgreSQL database engine\") \\| SQL Server\n\n\u003cbr /\u003e\n\nThis page summarizes the Cloud SQL Language Connectors and how to use them\nwith your instances.\n\nCloud SQL Language Connectors are libraries that provide encryption and\n[IAM](/iam) authorization when connecting to a Cloud SQL instance.\nCloud SQL Language Connectors create authorized connections to the\nproxy-side server on behalf of a user's application and pass that connection to\nthe application's database driver. They don't provide a network path to a\nCloud SQL instance if one is not already present.\n\nCloud SQL Language Connectors use a client-side component to connect to a proxy server\non the Cloud SQL instance. The connector creates a temporary certificate\nthat authorizes the holder to connect to the server-side proxy. The server-side\nproxy limits access to the Cloud SQL database by requiring a valid TLS\ncertificate in order to connect.\n\nCloud SQL supports the following Cloud SQL Language Connectors:\n\n- [Cloud SQL Java connector](/sql/docs/sqlserver/connect-connectors#java)\n- [Cloud SQL Python connector](/sql/docs/sqlserver/connect-connectors#python)\n- [Cloud SQL Go connector](/sql/docs/sqlserver/connect-connectors#go)\n- [Cloud SQL Node.js connector](/static/sql/docs/sqlserver/connect-connectors#node.js)\n\nCloud SQL recommends using Cloud SQL Language Connectors to connect to your\nCloud SQL instance. You can also connect to a Cloud SQL\ninstance [using a database client](/sql/docs/sqlserver/connect-admin-ip) or the\n[Cloud SQL Auth Proxy](/sql/docs/sqlserver/sql-proxy). For more information about\nconnecting to a Cloud SQL instance, see [About connection options](/sql/docs/sqlserver/connect-overview).\n\nRequirements\n------------\n\nIf your Cloud SQL instance uses\n[shared certificate authority (CA)](/sql/docs/sqlserver/authorize-ssl#shared-regional-ca)\nas its `serverCaMode`, then on the client side,\nmake sure that the Cloud SQL Language Connectors you're using meet\nthe following version requirements:\n\n- [Cloud SQL Java connector](/sql/docs/sqlserver/connect-connectors#java): [v1.21.0](https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/releases/tag/v1.21.0) or later\n- [Cloud SQL Go connector](/sql/docs/sqlserver/connect-connectors#go): [v1.12.0](https://github.com/GoogleCloudPlatform/cloud-sql-go-connector/releases/tag/v1.12.0) or later\n- [Cloud SQL Node.js connector](/static/sql/docs/sqlserver/connect-connectors#node.js): [v1.4.0](https://github.com/GoogleCloudPlatform/cloud-sql-nodejs-connector/releases/tag/v1.4.0) or later\n\n| **Note:** [Cloud SQL Python connector](/sql/docs/sqlserver/connect-connectors#python) supports instances that use the shared CA configuration, but the connector doesn't verify server identity.\n\nIf your Cloud SQL instance uses\n[customer-managed CA](/sql/docs/sqlserver/authorize-ssl#customer-managed-ca)\nas its `serverCaMode`, then on the client side,\nmake sure that the Cloud SQL Language Connectors you're using meet\nthe following version requirements:\n\n- [Cloud SQL Java connector](/sql/docs/sqlserver/connect-connectors#java): [v1.22.0](https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/releases/tag/v1.22.0) or later\n- [Cloud SQL Go connector](/sql/docs/sqlserver/connect-connectors#go): [v1.14.0](https://github.com/GoogleCloudPlatform/cloud-sql-go-connector/releases/tag/v1.14.0) or later\n- [Cloud SQL Node.js connector](/static/sql/docs/sqlserver/connect-connectors#node.js): [v1.6.0](https://github.com/GoogleCloudPlatform/cloud-sql-nodejs-connector/releases/tag/v1.6.0) or later\n\nWhen an instance uses customer-managed CA as its server CA mode, you can configure\nthe instance with a [custom DNS name](/sql/docs/sqlserver/configure-ssl-instance#custom-dns-name).\nYou provide the custom DNS name in the\ncustom subject alternative name (SAN) field of the server certificate.\n\nAfter you set up a custom DNS name for the instance, you can connect to the\ninstance from Cloud SQL Language Connectors using the DNS name.\n\nBenefits of Cloud SQL Language Connectors\n-----------------------------------------\n\nCloud SQL Language Connectors provide the following\nbenefits with connecting to a Cloud SQL instance:\n\n- **IAM authorization**: Uses identity and access management (IAM) permissions to control who or what can connect to your Cloud SQL instances.\n- **Convenience**: Removes the requirement to manage SSL certificates, configure firewall rules, or enable authorized networks.\n\n\u003cbr /\u003e\n\nLimitations\n-----------\n\nYou can't use the Cloud SQL Language Connectors if you're using\n[context-aware access](/iap/docs/cloud-iap-context-aware-access-howto) and\nIAM database authentication. When you try to login to the instance,\nIAM authentication fails.\n\nEnforce the use of Cloud SQL Language Connectors\n------------------------------------------------\n\nBy using [connector enforcement](/sql/docs/sqlserver/admin-api/rest/v1/instances#ConnectorEnforcement), you can enforce using only the Cloud SQL Auth Proxy or Cloud SQL Language Connectors to connect to Cloud SQL instances. With connector enforcement, Cloud SQL rejects direct connections to the database.\n\nIf you're using a [Private Service Connect-enabled instance](/sql/docs/sqlserver/about-private-service-connect), then there's a limitation. If the instance has connector enforcement enabled, then you can't create read replicas for the instance. Similarly, if the instance has read replicas, then you can't enable connector enforcement for the instance.\n\nFor more information about how to enforce using only the Cloud SQL Auth Proxy or Cloud SQL Language Connectors to connect to an instance, see [Connect using Cloud SQL Language Connectors](/sql/docs/sqlserver/connect-connectors#enforce).\n\nWhat's next\n-----------\n\n\u003cbr /\u003e\n\n- [Connect using the Cloud SQL Java Connector](/sql/docs/sqlserver/connect-connectors#java).\n- [Connect using the Cloud SQL Python Connector](/sql/docs/sqlserver/connect-connectors#python).\n- [Connect using the Cloud SQL Go Connector](/sql/docs/sqlserver/connect-connectors#go).\n- [Connect using the Cloud SQL Node.js Connector](/static/sql/docs/sqlserver/connect-connectors#node.js).\n- Learn more about the [Cloud SQL Auth Proxy](/sql/docs/sqlserver/sql-proxy).\n\n\u003cbr /\u003e"]]