Relational Database ServiceRelational Database Service

Compute
Elastic Cloud Server
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
Domain Name Service
VPC Endpoint
Cloud Connect
Enterprise Switch
Security & Compliance
Anti-DDoS
Web Application Firewall
Host Security Service
Data Encryption Workshop
Database Security Service
Advanced Anti-DDoS
Data Security Center
Container Guard Service
Situation Awareness
Managed Threat Detection
Compass
Cloud Certificate Manager
Anti-DDoS Service
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GaussDB NoSQL
GaussDB(for MySQL)
Distributed Database Middleware
GaussDB(for openGauss)
Developer Services
ServiceStage
Distributed Cache Service
Simple Message Notification
Application Performance Management
Application Operations Management
Blockchain
API Gateway
Cloud Performance Test Service
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
DevCloud
ProjectMan
CodeHub
CloudRelease
CloudPipeline
CloudBuild
CloudDeploy
Cloud Communications
Message & SMS
Cloud Ecosystem
Marketplace
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP License Service
Support Plans
Customer Operation Capabilities
Partner Support Plans
Professional Services
enterprise-collaboration
Meeting
IoT
IoT
Intelligent EdgeFabric
DeveloperTools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Updated at: Apr 02, 2022 GMT+08:00

Creating a Database

Scenarios

After a DB instance is created, you can create databases on it.

Constraints

  • Databases cannot be created for DB instances that are in the process of being restored.
  • This section applies only to the MySQL DB engine.
  • Database names must be unique.
  • After a database is created, the database name cannot be changed.

Creating a Database through RDS

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Database > Relational Database Service. The RDS console is displayed.
  4. On the Instance Management page, click the target DB instance.
  5. On the Databases page, click Create Database. In the displayed dialog box, enter a database name and remarks, select a character set, and authorize permissions for users. Then, click OK.

    Figure 1 Creating a database
    • The database name consists of 1 to 64 characters. Only letters, digits, hyphens (-), underscores (_), and dollar signs ($) are allowed. MySQL 8.0 does not support dollar signs ($). The total number of hyphens (-) and dollar signs ($) cannot exceed 10.
    • The default character set is utf8. You can click More and select another one.
    • The remarks can contain 1 to 512 characters. This parameter is supported only for specified kernel versions. If your kernel version does not meet the requirements, upgrade the kernel to the latest version by referring to Upgrading a Minor Version.
      • For RDS for MySQL 5.6, the kernel version should be 5.6.51.3 or later to add the remarks.
      • For RDS for MySQL 5.7, the kernel version should be 5.7.33.1 or later to add the remarks.
      • For RDS for MySQL 8.0, the kernel version should be 8.0.21.4 or later to add the remarks.
    • Select unauthorized users and click to authorize permissions (mandatory) or select authorized users and click to revoke permissions.

      If there are no unauthorized users, you can create one by referring to section Creating a Database Account.

    • If you require fine-grained permissions control, log in to the database through the DAS console.

  6. After the database is created, you can manage it on the Databases page of the selected DB instance.

    The AUTO_PK_ROW_ID column name is a reserved column name for the RDS for MySQL database and cannot be created by users.

Creating a Database through DAS

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Database > Relational Database Service. The RDS console is displayed.
  4. On the Instance Management page, locate the target DB instance and choose More > Log In in the Operation column.
  5. On the displayed login page, enter the correct username and password and click Log In.
  6. In the SQL window on the DAS console, run the following command to create a database:

    create database Database name;

Did you find this page helpful?

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel