All Products
Search
Document Center

ApsaraDB RDS:What do I do if an error is reported when I manage the database accounts of an ApsaraDB RDS for MySQL instance in the ApsaraDB RDS console?

Last Updated:Nov 22, 2024

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'@'%';
      Note
    • 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