This topic describes how to create and delete databases in an ApsaraDB MyBase for MySQL instance.
Prerequisites
You have created an ApsaraDB MyBase for MySQL instance. For more information, see Create an ApsaraDB MyBase for MySQL instance.
Create a database
Log on to the ApsaraDB for MyBase console.
In the upper-left corner of the page, select the target region.
In the navigation pane on the left, click .
Find the target instance, click Details in the Actions column, and then choose Databases.
On the Databases page, click Create Database.
In the Create Database dialog box, configure the following parameters.
Parameter
Description
Database name
The name can be up to 64 characters long.
It must start with a letter and end with a letter or a digit.
It can contain only lowercase letters, digits, underscores (_), and hyphens (-).
The database name must be unique within the instance.
Supported character set
Select a character set based on your business requirements.
Authorized account
Select the accounts that you want to authorize to access the database. You can also perform one of the following operations:
Click Create Account to add a new account. For more information, see Create a database account.
Leave this parameter empty. You can grant permissions to an account after the database is created. For more information, see Modify account permissions.
NoteOnly standard accounts are displayed. A privileged account has full permissions on all databases and does not require authorization.
Description
Optional. Enter a description for the database to help you manage it later. The description can be up to 256 characters long.
Click Create.
Delete a database using the console
Log on to the ApsaraDB for MyBase console.
In the upper-left corner of the page, select the target region.
In the navigation pane on the left, click .
Find the target instance, click Details in the Actions column, and then choose Databases.
Find the database to delete and click Delete in the Actions column.
In the confirmation dialog box, click OK.
In the dialog box that appears, complete the SMS verification.
Delete a database using the CLI
Connect to the instance. For more information, see Connect to an ApsaraDB MyBase for MySQL instance.
Run the following command to delete a database:
drop database <database name>;