Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Контейнеры
    • Инструменты разработчика
    • Бессерверные вычисления
    • Безопасность
    • Мониторинг и управление ресурсами
    • Машинное обучение
    • Бизнес-инструменты
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Истории успеха
    • Тарифы Yandex Cloud
    • Промоакции и free tier
    • Правила тарификации
  • Документация
  • Блог
Проект Яндекса
© 2025 ООО «Яндекс.Облако»
Yandex Managed Service for MySQL®
  • Начало работы
  • Управление доступом
  • Справочник Terraform
    • Аутентификация в API
      • Overview
        • Overview
        • Get
        • List
        • Create
        • Update
        • Delete
        • GrantPermission
        • RevokePermission
  • Метрики Monitoring
  • Аудитные логи Audit Trails
  • Публичные материалы
  • История изменений
  • Обучающие курсы

В этой статье:

  • gRPC request
  • UpdateUserRequest
  • Permission
  • ConnectionLimits
  • operation.Operation
  • UpdateUserMetadata
  • User
  • Permission
  • ConnectionLimits
  • ConnectionManager
  1. Справочник API
  2. gRPC (англ.)
  3. User
  4. Update

Managed Service for MySQL API, gRPC: UserService.Update

Статья создана
Yandex Cloud
Улучшена
Tania L.
Обновлена 21 февраля 2025 г.
  • gRPC request
  • UpdateUserRequest
  • Permission
  • ConnectionLimits
  • operation.Operation
  • UpdateUserMetadata
  • User
  • Permission
  • ConnectionLimits
  • ConnectionManager

Updates a user in a cluster.

gRPC requestgRPC request

rpc Update (UpdateUserRequest) returns (operation.Operation)

UpdateUserRequestUpdateUserRequest

{
  "cluster_id": "string",
  "user_name": "string",
  "update_mask": "google.protobuf.FieldMask",
  "password": "string",
  "permissions": [
    {
      "database_name": "string",
      "roles": [
        "Privilege"
      ]
    }
  ],
  "global_permissions": [
    "GlobalPermission"
  ],
  "connection_limits": {
    "max_questions_per_hour": "google.protobuf.Int64Value",
    "max_updates_per_hour": "google.protobuf.Int64Value",
    "max_connections_per_hour": "google.protobuf.Int64Value",
    "max_user_connections": "google.protobuf.Int64Value"
  },
  "authentication_plugin": "AuthPlugin",
  "generate_password": "google.protobuf.BoolValue"
}

Field

Description

cluster_id

string

Required field. ID of the cluster to update the user in.

To get this ID, make a ClusterService.List request.

user_name

string

Required field. Name of the user to update.

To get this name, make a UserService.List request.

update_mask

google.protobuf.FieldMask

Field mask that specifies which settings of the user should be updated.

password

string

New password for the user.

permissions[]

Permission

A new set of permissions that should be granted to the user.

global_permissions[]

enum GlobalPermission

New set of global permissions to grant to the user.

  • GLOBAL_PERMISSION_UNSPECIFIED

  • REPLICATION_CLIENT: Enables use of the SHOW MASTER STATUS, SHOW SLAVE STATUS, and SHOW BINARY LOGS statements.

  • REPLICATION_SLAVE: Enables the account to request updates that have been made to databases on the master server,
    using the SHOW SLAVE HOSTS, SHOW RELAYLOG EVENTS and SHOW BINLOG EVENTS statements.

  • PROCESS: Enables display of information about the the statements currently being performed by sessions (the set of threads executing within the server).

    The privilege enables use of SHOW PROCESSLIST or mysqladmin processlist to see threads belonging to other users.
    You can always see your own threads. The PROCESS privilege also enables use of SHOW ENGINE.

  • FLUSH_OPTIMIZER_COSTS: Enables use of the FLUSH OPTIMIZER_COSTS statement.

  • SHOW_ROUTINE: Enables a user to access definitions and properties of all stored routines (stored procedures and functions), even those for which the user is not named as the routine DEFINER.
    This access includes:
    The contents of the Information Schema ROUTINES table.
    The SHOW CREATE FUNCTION and SHOW CREATE PROCEDURE statements.
    The SHOW FUNCTION CODE and SHOW PROCEDURE CODE statements.
    The SHOW FUNCTION STATUS and SHOW PROCEDURE STATUS statements.

connection_limits

ConnectionLimits

Set of changed user connection limits.

authentication_plugin

enum AuthPlugin

New user authentication plugin.

  • AUTH_PLUGIN_UNSPECIFIED
  • MYSQL_NATIVE_PASSWORD: Use Native Pluggable Authentication.
  • CACHING_SHA2_PASSWORD: Use Caching SHA-2 Pluggable Authentication.
  • SHA256_PASSWORD: Use SHA-256 Pluggable Authentication.
  • MYSQL_NO_LOGIN: Use MYSQL_NO_LOGIN Pluggable Authentication.
  • MDB_IAMPROXY_AUTH: Use IAM Pluggable Authentication.

generate_password

google.protobuf.BoolValue

Generate password using Connection Manager.

PermissionPermission

Field

Description

database_name

string

Name of the database that the permission grants access to.

roles[]

enum Privilege

Roles granted to the user within the database.

See the documentation for details.

  • PRIVILEGE_UNSPECIFIED

  • ALL_PRIVILEGES: All privileges that can be made available to the user.

  • ALTER: Altering tables.

  • ALTER_ROUTINE: Altering stored routines and functions.

  • CREATE: Creating tables or indexes.

  • CREATE_ROUTINE: Creating stored routines.

  • CREATE_TEMPORARY_TABLES: Creating temporary tables.

  • CREATE_VIEW: Creating views.

  • DELETE: Deleting tables.

  • DROP: Removing tables or views.

  • EVENT: Creating, altering, dropping, or displaying events for the Event Scheduler.

  • EXECUTE: Executing stored routines.

  • INDEX: Creating and removing indexes.

  • INSERT: Inserting rows into the database.

  • LOCK_TABLES: Using LOCK TABLES statement for tables available with SELECT privilege.

  • SELECT: Selecting rows from tables.

    Some SELECT statements can be allowed without the SELECT privilege. All statements that read column values require the SELECT privilege.

    See MySQL documentation for details.

  • SHOW_VIEW: Using the SHOW CREATE VIEW statement. Also needed for views used with EXPLAIN.

  • TRIGGER: Creating, removing, executing, or displaying triggers for a table.

  • UPDATE: Updating rows in the database.

  • REFERENCES: Creation of a foreign key constraint for the parent table.

ConnectionLimitsConnectionLimits

Field

Description

max_questions_per_hour

google.protobuf.Int64Value

The maximum permitted number of user questions per hour.

max_updates_per_hour

google.protobuf.Int64Value

The maximum permitted number of user updates per hour.

max_connections_per_hour

google.protobuf.Int64Value

The maximum permitted number of simultaneous client connections per hour.

max_user_connections

google.protobuf.Int64Value

The maximum number of simultaneous connections permitted to any given MySQL user account.

operation.Operationoperation.Operation

{
  "id": "string",
  "description": "string",
  "created_at": "google.protobuf.Timestamp",
  "created_by": "string",
  "modified_at": "google.protobuf.Timestamp",
  "done": "bool",
  "metadata": {
    "cluster_id": "string",
    "user_name": "string"
  },
  // Includes only one of the fields `error`, `response`
  "error": "google.rpc.Status",
  "response": {
    "name": "string",
    "cluster_id": "string",
    "permissions": [
      {
        "database_name": "string",
        "roles": [
          "Privilege"
        ]
      }
    ],
    "global_permissions": [
      "GlobalPermission"
    ],
    "connection_limits": {
      "max_questions_per_hour": "google.protobuf.Int64Value",
      "max_updates_per_hour": "google.protobuf.Int64Value",
      "max_connections_per_hour": "google.protobuf.Int64Value",
      "max_user_connections": "google.protobuf.Int64Value"
    },
    "authentication_plugin": "AuthPlugin",
    "connection_manager": {
      "connection_id": "string"
    }
  }
  // end of the list of possible fields
}

An Operation resource. For more information, see Operation.

Field

Description

id

string

ID of the operation.

description

string

Description of the operation. 0-256 characters long.

created_at

google.protobuf.Timestamp

Creation timestamp.

created_by

string

ID of the user or service account who initiated the operation.

modified_at

google.protobuf.Timestamp

The time when the Operation resource was last modified.

done

bool

If the value is false, it means the operation is still in progress.
If true, the operation is completed, and either error or response is available.

metadata

UpdateUserMetadata

Service-specific metadata associated with the operation.
It typically contains the ID of the target resource that the operation is performed on.
Any method that returns a long-running operation should document the metadata type, if any.

error

google.rpc.Status

The error result of the operation in case of failure or cancellation.

Includes only one of the fields error, response.

The operation result.
If done == false and there was no failure detected, neither error nor response is set.
If done == false and there was a failure detected, error is set.
If done == true, exactly one of error or response is set.

response

User

The normal response of the operation in case of success.
If the original method returns no data on success, such as Delete,
the response is google.protobuf.Empty.
If the original method is the standard Create/Update,
the response should be the target resource of the operation.
Any method that returns a long-running operation should document the response type, if any.

Includes only one of the fields error, response.

The operation result.
If done == false and there was no failure detected, neither error nor response is set.
If done == false and there was a failure detected, error is set.
If done == true, exactly one of error or response is set.

UpdateUserMetadataUpdateUserMetadata

Field

Description

cluster_id

string

ID of the cluster the user is being updated in.

user_name

string

Name of the user that is being updated.

UserUser

An object that represents MySQL user.

See the documentation for details.

Field

Description

name

string

Name of the user.

cluster_id

string

ID of the cluster the user belongs to.

permissions[]

Permission

Set of permissions granted to the user.

global_permissions[]

enum GlobalPermission

Set of global permissions to grant to the user.

  • GLOBAL_PERMISSION_UNSPECIFIED

  • REPLICATION_CLIENT: Enables use of the SHOW MASTER STATUS, SHOW SLAVE STATUS, and SHOW BINARY LOGS statements.

  • REPLICATION_SLAVE: Enables the account to request updates that have been made to databases on the master server,
    using the SHOW SLAVE HOSTS, SHOW RELAYLOG EVENTS and SHOW BINLOG EVENTS statements.

  • PROCESS: Enables display of information about the the statements currently being performed by sessions (the set of threads executing within the server).

    The privilege enables use of SHOW PROCESSLIST or mysqladmin processlist to see threads belonging to other users.
    You can always see your own threads. The PROCESS privilege also enables use of SHOW ENGINE.

  • FLUSH_OPTIMIZER_COSTS: Enables use of the FLUSH OPTIMIZER_COSTS statement.

  • SHOW_ROUTINE: Enables a user to access definitions and properties of all stored routines (stored procedures and functions), even those for which the user is not named as the routine DEFINER.
    This access includes:
    The contents of the Information Schema ROUTINES table.
    The SHOW CREATE FUNCTION and SHOW CREATE PROCEDURE statements.
    The SHOW FUNCTION CODE and SHOW PROCEDURE CODE statements.
    The SHOW FUNCTION STATUS and SHOW PROCEDURE STATUS statements.

connection_limits

ConnectionLimits

Set of user connection limits.

authentication_plugin

enum AuthPlugin

User authentication plugin.

  • AUTH_PLUGIN_UNSPECIFIED
  • MYSQL_NATIVE_PASSWORD: Use Native Pluggable Authentication.
  • CACHING_SHA2_PASSWORD: Use Caching SHA-2 Pluggable Authentication.
  • SHA256_PASSWORD: Use SHA-256 Pluggable Authentication.
  • MYSQL_NO_LOGIN: Use MYSQL_NO_LOGIN Pluggable Authentication.
  • MDB_IAMPROXY_AUTH: Use IAM Pluggable Authentication.

connection_manager

ConnectionManager

Connection Manager Connection and settings associated with user. Read only field.

PermissionPermission

Field

Description

database_name

string

Name of the database that the permission grants access to.

roles[]

enum Privilege

Roles granted to the user within the database.

See the documentation for details.

  • PRIVILEGE_UNSPECIFIED

  • ALL_PRIVILEGES: All privileges that can be made available to the user.

  • ALTER: Altering tables.

  • ALTER_ROUTINE: Altering stored routines and functions.

  • CREATE: Creating tables or indexes.

  • CREATE_ROUTINE: Creating stored routines.

  • CREATE_TEMPORARY_TABLES: Creating temporary tables.

  • CREATE_VIEW: Creating views.

  • DELETE: Deleting tables.

  • DROP: Removing tables or views.

  • EVENT: Creating, altering, dropping, or displaying events for the Event Scheduler.

  • EXECUTE: Executing stored routines.

  • INDEX: Creating and removing indexes.

  • INSERT: Inserting rows into the database.

  • LOCK_TABLES: Using LOCK TABLES statement for tables available with SELECT privilege.

  • SELECT: Selecting rows from tables.

    Some SELECT statements can be allowed without the SELECT privilege. All statements that read column values require the SELECT privilege.

    See MySQL documentation for details.

  • SHOW_VIEW: Using the SHOW CREATE VIEW statement. Also needed for views used with EXPLAIN.

  • TRIGGER: Creating, removing, executing, or displaying triggers for a table.

  • UPDATE: Updating rows in the database.

  • REFERENCES: Creation of a foreign key constraint for the parent table.

ConnectionLimitsConnectionLimits

Field

Description

max_questions_per_hour

google.protobuf.Int64Value

The maximum permitted number of user questions per hour.

max_updates_per_hour

google.protobuf.Int64Value

The maximum permitted number of user updates per hour.

max_connections_per_hour

google.protobuf.Int64Value

The maximum permitted number of simultaneous client connections per hour.

max_user_connections

google.protobuf.Int64Value

The maximum number of simultaneous connections permitted to any given MySQL user account.

ConnectionManagerConnectionManager

Field

Description

connection_id

string

ID of Connection Manager Connection

Была ли статья полезна?

Предыдущая
Create
Следующая
Delete
Проект Яндекса
© 2025 ООО «Яндекс.Облако»