tencent cloud

TencentDB for MariaDB

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Strengths
Use Cases
System Architecture
Instance Types
Instance Architecture
TDSQL Edition
Database Version
Purchase Guide
Billing Overview
Pricing
Refund
Payment Overdue
Upgrade Pricing
Backup Space Billing
Getting Started
Creating Instance
Managing Account
Accessing Instance
Operation Guide
Precautions
Instance Management
Disaster Recovery Read-Only Instance
Account Management
Read/Write Separation
Changing Networks
Backup and Rollback
Migrating Data
Database Sync(Legacy)
Security Management
Monitoring and Alarms
Killing Threads
Parameter Templates and Settings
Database Audit
Practical Tutorial
Programming and Usage Specification
Programming and Usage Specification of Distributed Version
Using Hotspot Update for Flash Sales
Security White Paper
Platform Security Features
Tenant Security Features
Development Guide
Functional Limitations
Performance Test
Intra-city Active-Active Solution
Binlog Consumption Format
Slow Query Analysis
Database Audit
Syntax Supported
API Documentation
History
Introduction
API Category
Making API Requests
Security Group APIs
Other APIs
Account APIs
Parameter Management APIs
Monitoring Management APIs
Instance Management APIs
Backup and Restoration APIs
Data Types
Error Codes
FAQs
Product
Account Login
Features
Performance
Backup
Ops
Disk Overuse
IO Metric Exception
General References
Standards and Certification
Main Specification Performance Description
Performance Comparison Data for Strong Sync
Glossary

ModifyAccountPrivileges

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2025-10-28 22:20:15

1. API Description

Domain name for API request: mariadb.intl.tencentcloudapi.com.

This API is used to modify the permissions of a TencentDB instance account. \n\nNote\n-Only the SELECT permission (that is, set the permission parameter to ["SELECT"]) of the system database mysql can be granted.An error will be reported if read-write permissions are granted to a read-only account. If the parameter is not passed in, no change will be made to the granted table permissions. To clear the granted view permissions, set Privileges to an empty array.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ModifyAccountPrivileges.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
InstanceId Yes String Instance ID in the format of tdsql-c1nl9rpv. It is the same as the instance ID displayed in the TencentDB console.
Accounts.N Yes Array of Account Database account, including username and host address.
GlobalPrivileges.N No Array of String Global permission. Valid values of GlobalPrivileges: "SELECT", "INSERT", "UPDATE", "DELETE", "CREATE", "PROCESS", "DROP", "REFERENCES", "INDEX", "ALTER", "SHOW DATABASES", "CREATE TEMPORARY TABLES", "LOCK TABLES", "EXECUTE", "CREATE VIEW", "SHOW VIEW", "CREATE ROUTINE", "ALTER ROUTINE", "EVENT", "TRIGGER".
Note: if the parameter is left empty, no change will be made to the granted global permissions. To clear the granted global permissions, set the parameter to an empty array.
DatabasePrivileges.N No Array of DatabasePrivilege Database permission. Valid values of Privileges: "SELECT", "INSERT", "UPDATE", "DELETE", "CREATE", "DROP", "REFERENCES", "INDEX", "ALTER", "CREATE TEMPORARY TABLES", "LOCK TABLES", "EXECUTE", "CREATE VIEW", "SHOW VIEW", "CREATE ROUTINE", "ALTER ROUTINE", "EVENT", "TRIGGER".
Note: if the parameter is left empty, no change will be made to the granted database permissions. To clear the granted database permissions, set Privileges to an empty array.
TablePrivileges.N No Array of TablePrivilege Database table permission. Valid values of Privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER.
Note: if the parameter is not passed in, no change will be made to the granted table permissions. To clear the granted table permissions, set Privileges to an empty array.
ColumnPrivileges.N No Array of ColumnPrivilege Column permission. Valid values of Privileges: "SELECT", "INSERT", "UPDATE", "REFERENCES".
Note: if the parameter is left empty, no change will be made to the granted column permissions. To clear the granted column permissions, set Privileges to an empty array.
ViewPrivileges.N No Array of ViewPrivileges Database view permission. Valid values of Privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER.
Note: if the parameter is not passed in, no change will be made to the granted view permissions. To clear the granted view permissions, set Privileges to an empty array.
FunctionPrivileges.N No Array of FunctionPrivilege Database function permissions. Valid values of Privileges: ALTER ROUTINE, EXECUTE.
Note: if the parameter is not passed in, no change will be made to the granted function permissions. To clear the granted function permissions, set Privileges to an empty array.
ProcedurePrivileges.N No Array of ProcedurePrivilege Database stored procedure permission. Valid values of Privileges: ALTER ROUTINE, EXECUTE.
Note: if the parameter is not passed in, no change will be made to the granted stored procedure permissions. To clear the granted stored procedure permissions, set Privileges to an empty array.

3. Output Parameters

Parameter Name Type Description
FlowId Integer Async task ID, which can be used in the DescribeFlow API to query the async task result.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Modifying the permissions of a TencentDB instance account

This example shows you how to modify the permissions of a TencentDB instance account.

Input Example

https://mariadb.intl.tencentcloudapi.com/?Action=ModifyAccountPrivileges&InstanceId=tdsql-f35wr6wj&Accounts.0.User=ajnnw&GlobalPrivileges.0=SELECT&Accounts.0.Host=127.0.0.1&<common request parameters>

Output Example

{
    "Response": {
        "RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7",
        "FlowId": 145623
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure CAM signature/authentication error
FailedOperation.CreateFlowFailed Failed to create the flow.
FailedOperation.OssOperationFailed Failed to request the backend API.
InternalError.DbOperationFailed Failed to query the database.
InvalidParameterValue.BadUserRight The specified permission could not be granted to this account.
ResourceUnavailable.InstanceHasBeenLocked The database instance has been locked. Operations are not allowed.
ResourceUnavailable.InstanceStatusAbnormal Incorrect database instance status. Operations are not allowed.
UnauthorizedOperation.PermissionDenied You have no permission to manipulate this API or resource.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan