This topic describes the causes of and solutions to the errors that may be reported when you modify the permissions of a database account or delete a database account of an ApsaraDB RDS for MySQL instance in the ApsaraDB RDS console.
Problem description
The
Account.UpdateError
error is reported when you modify the database account permissions of an RDS instance in the ApsaraDB RDS console.The
Account.DelError
error is reported when you delete a database account from an RDS instance in the ApsaraDB RDS console.
Causes
If the value of host of the database account that is created by using the MySQL command line is not a percent sign (%
), you cannot modify the permissions of the database account or delete the database account in the ApsaraDB RDS console. The value % indicates that logons from all hosts or IP addresses are allowed.
Solutions
Scenario 1: Use the privileged account and the MySQL command line to authorize or delete the account.
Authorization statement:
GRANT '<Permissions, such as CREATE>' ON *.* TO '<Username of the standard account that you want to authorize>'@'<Host, such as % to allow access from any host>';
Sample statement:
-- Grant the creation and query permissions on all databases to the zhttest account. GRANT CREATE, SELECT ON *.* TO 'zhttest'@'%';
NoteFor more information about the GRANT statement, see Official MySQL documentation.
For more information about the permissions that can be granted, see Account permissions.
Deletion statement:
DROP USER '<Username of the standard account that you want to delete>'@'<Host, such as % to allow access from any host>';
Sample statement:
-- Delete the zttest account. DROP USER 'zhttest'@'%';
Solution 2: Use the privileged account and the MySQL command line to change the value of host of a database account to
%
and then authorize or delete the account in the ApsaraDB RDS console.UPDATE mysql.user SET host='%' WHERE user='<Username of the standard account>';
Sample statement:
-- Change the value of host of the zhttest account to % to allow logons from any host. UPDATE mysql.user SET host='%' WHERE user='zhttest';
References
For more information about how to connect to an RDS instance, see Use a client or the CLI to connect to an ApsaraDB RDS for MySQL instance.
For more information about how to modify the permissions of a database account by using the ApsaraDB RDS console, SQL statements, or API operations, see Modify the permissions of an account or GrantAccountPrivilege.
For more information about how to delete a database account by using the ApsaraDB RDS console, SQL statements, or API operations, see Delete an account or DeleteAccount.