This document is applicable only to MySQL 5.7 High-availability Edition, MySQL 5.5, and MySQL 5.6 instances. For more information about how to create a database and an account for MySQL 5.7, see Create account and database for MySQL 5.7 Basic Edition.

Before using RDS, you must create databases and accounts for the RDS instance. For MySQL 5.7 High-availability Edition, MySQL 5.5, and MySQL 5.6 instances, this document provides detailed procedure to create and manage databases and accounts directly on the RDS console.

Attentions

  • Databases under a single instance share all the resources of this instance. Each instance supports up to 500 databases and 500 accounts.
  • To migrate your local database to the RDS instance, you must create the same databases and accounts as those of on the local database.
  • When assigning account permissions for each database, follow the minimum permissions’ principle and consider service roles to create accounts. Additionally, rationally assign read-only and read/write permissions. When necessary, you can split accounts and databases into smaller units so that each account can only access data for its own services. If the account does not need to write data to a database, assign the read-only permission for the account.
  • For database security, set strong passwords for the accounts and change the passwords regularly.

Procedure

  1. Log on to the RDS console.
  2. Select the region where the target instance is located.
  3. Click the ID of the instance to visit the Basic Information page.
  4. Select Account Management in the left-side navigation pane to visit the Account Management page.
  5. Click Create Account, as shown in the following figure.


  6. To create an account, set the related fields, as shown in the following figure.


    Parameters description:

    • Database Account: refers to the account name. It contains 2 to 16 characters including lower-case letters, digits, or underscores (_). It must begin with a letter and end with a letter or a digit.
    • Authorized Database: refers to the database that this account is authorized to access. If there is no database, you do not need set this field. Do as follows to authorize an account to access multiple databases:
      1. In the Unauthorized Database box, select the target database.
      2. Click Authorize to add the selected database to the Authorized Database box.
      3. You can authorize the Read-only or Read/Write permission to the account for each authorized database. If you want to authorize the same permissions to the account for accessing all the authorized databases, click Set All Read/Write or Set All Read-only, as shown in the following figure.


        • Password: refers to the password of this account. It contains 8 to 32 characters including at least three of the following: capital letters, lower-case letters, digits, and special characters ( !@#$%^&*()_-+=)
        • Re-enter Password: re-enter the password to make sure the password is entered correctly.
        • Note: You can add additional information about this account for the convenience of follow-up account management. A maximum of 256 English characters can be entered (one Chinese character equals to three English characters).
  7. Click OK. An account is created.
  8. Select Database Management in the left-side navigation pane to visit the Database Management page.
  9. Click Create Database, as shown in the following figure.


  10. Enter the information about the database, as shown in the following figure.


    Parameters description:

    • Database (DB) Name: contains 2 to 64 characters including the lowercase letters, digits, underscores (_), or hyphens (-). It must begin with a letter and end with a letter or a digit.
    • Supported Character Set: refers to the supported character set of the database. You can select utf8, gbk, latin1, or utf8mb4.
    • Authorized Account: You can select an account authorized to access this database. Set this field only if the account is created.
    • Account Type: This option is visible after Authorized Account is set. You can authorize the Read/Write or Read-only permission to the authorized account.
    • Remarks: Enter additional information about this database for subsequent database management. A maximum of 256 English characters can be entered (one Chinese character equals to three English characters).
  11. Click OK. A database is created.