[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Translation issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
实例访问权限控制
本页介绍适用于 Cloud SQL 实例的两个访问权限控制级别。您必须先配置两个访问权限控制级别,然后才能管理实例。
访问权限控制级别
配置访问权限控制涉及控制谁或什么可以访问该实例。访问权限控制分为两个级别:
- 实例级访问权限
-
实例级访问权限会授予某一应用或客户端(在 App Engine 上运行或在外部环境中运行)或者另一项 Google Cloud 服务(如 Compute Engine)对您 Cloud SQL 实例的访问权限。
- 数据库访问权限
-
数据库访问权限使用服务器级角色来控制哪些 SQL Server 用户可以访问您实例中的数据。
实例级访问权限
实例级访问权限的配置方式取决于您从何处发起连接:
连接源 |
访问权限配置选项 |
更多信息 |
GKE |
|
|
App Engine 标准环境 |
- 相同项目:配置 IAM
- 不同项目之间:配置 IAM
|
|
App Engine 柔性环境 |
|
|
sqlcmd 客户端 |
- Cloud SQL 代理
- 为客户端 IP 地址授权
|
|
外部应用 |
- Cloud SQL 代理
- 为客户端 IP 地址授权
|
|
云端函数 |
- 使用公共 IP 地址设置的 Cloud SQL 实例。
- 不同项目之间:也要配置 IAM
|
|
Cloud Run |
- 使用公共 IP 地址设置的 Cloud SQL 实例。
- 不同项目之间:也要配置 IAM
|
|
Google Kubernetes Engine |
- 专用 IP 或 Cloud SQL 代理
- 如果是公共 IP 地址,则需要 Cloud SQL 代理
|
|
数据库访问权限
协商完与实例的连接后,用户或应用必须使用用户帐号登录数据库实例。您可以在管理 Cloud SQL 实例的过程中创建和管理用户帐号。
如需了解详情,请参阅 SQL Server 用户和创建和管理 SQL Server 用户。
后续步骤
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Translation issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-01-30 UTC.