All Products
Search
Document Center

ApsaraDB RDS:Modify account permissions

Last Updated:Sep 28, 2026

You can modify permissions for a standard account as needed. However, you cannot modify the permissions of a privileged account; you can only reset them to their initial state.

Note

To achieve more granular control, such as defining custom permission combinations or granting table-level permissions, use the permission management feature in Data Management Service (DMS). For more information, see Manage database accounts and permissions.

Method 1: Use the console

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.

  2. In the left-side navigation pane, click Accounts.

  3. Find the target account and click Change Permissions in the Actions column.

  4. In the Edit Account Permissions panel, adjust the account permissions.

    • To grant or revoke permissions for a database, select it and click the > or < icon.

    • Set access permissions: In the Authorized Databases list, you can set the permission level to Read/Write (DDL + DML), Read-only, DDL Only, or DML Only.

      Note

      For more granular permission control, use SQL statements to modify permissions. For details about the permissions, see Account permissions.

  5. Click OK.

Method 2: Use DMS

See Manage database accounts and permissions.

Method 3: Use SQL statements

Prerequisites

You must use a privileged account to grant permissions.

  1. Connect to an ApsaraDB RDS for MySQL instance by using the CLI or a client.

  2. Use the GRANT statement to grant permissions to the target account.

    Note

FAQ

Q: Why can't I create a database by using a standard account? The following error is returned: ERROR 1044 (42000): Access denied for user 'xxxx'@'%' to database 'xxxx'.

A:

By default, a standard account only has permission to log on to databases. You must use a privileged account to grant the CREATE privilege to the standard account. Example statement:

GRANT CREATE ON *.* TO '<standard-account-name>'@'%';

Q: How can I prevent users from accessing a database?

A: Remove all entries from the IP address whitelist except for 127.0.0.1. Then, restart the instance. This action blocks all external access to the database.

Q: Can I lock an account?

A: A privileged account can run the ALTER USER 'username' ACCOUNT LOCK; statement for itself or for a standard account. After the modification, restart the instance to terminate existing connections. To unlock a privileged account and restore its permissions, you can reset the permissions of the privileged account.

Note

ApsaraDB RDS for MySQL instances that run MySQL 5.6 do not support the ALTER USER 'username' ACCOUNT LOCK; statement.

Q: How do I grant an account the permissions required to view binary log files (local logs)?

A: To view the binary log files of an instance, you need the REPLICATION SLAVE and REPLICATION CLIENT permissions. Standard accounts and privileged accounts created in the console are granted these permissions by default. If you cannot view the binary log files, try using a privileged account or manually granting the required permissions with SQL statements.