このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ GaussDB(DWS)/ User Guide/ Creating a GaussDB(DWS) Database and User

Creating a GaussDB(DWS) Database and User

Updated on 2025-03-03 GMT+08:00

The default database gaussdb of GaussDB(DWS) is not used as the customer's service database. You can use multiple databases to ensure service isolation. When you first connect to gaussdb as the system administrator (dbadmin), it is important to plan the service databases, users, and roles based on the service requirements. This involves creating a service and transferring any existing upstream service data to GaussDB(DWS).

A role is a set of permissions. For details about the relationship between users and roles, see Permissions Management in the Developer Guide. You can create common roles, such as a role for database creation, before creating a user. Then, you can assign the created role to the user.

Users, roles, and permissions can be exported. For details, see Exporting a User, Exporting User Permissions, Exporting Roles, and Exporting Role Permissions.

Constraints and Limitations

  • Avoid having all business operations run under a single database user. Instead, plan different database users according to the business modules.
  • For better access control of different business modules, it is better to use multiple users and permissions instead of depending on the system administrator user to run business operations.
  • For more information about development and design specifications, see Development and Design Proposal.

Creating a Database

You can use the DDL syntax or SQL editor to create a table.

Creating a Role

  1. Log in to the GaussDB(DWS) console. In the navigation pane on the left, choose Dedicated Clusters > Clusters.
  2. In the cluster list, click the name of the target cluster. The cluster information page is displayed.
  3. In the navigation pane, choose User Management.
  4. Click the Roles tab and click Create Role. The role creation page is displayed.
  5. Configure role information. The parameters are described as follows:

    Table 1 Parameters for configuring role information

    Parameter

    Description

    Example Value

    Role Name

    The value must start with a letter and can contain a maximum of 63 characters, including letters, digits, and underscores (_).

    DWS-demo

    Expires

    Expiration time of the role permissions.

    -

    System Administrator

    Whether the role has the system administrator rights.

    -

    Create Database

    Whether the role has the permission to create databases.

    -

    Create Role

    Whether the role has the permission to create users and roles.

    -

    Inherit Permissions

    Whether the role inherits the permissions from its role group. By default, this function is enabled and it is best to keep it that way.

    -

  6. Confirm the settings and click Next.
  7. Configure the permissions of the role.

    Click Add to add a permission configuration. Select the database object type and the corresponding objects. Then, select permissions. For details about permission definitions, see "DCL Syntax" > "GRANT" in GaussDB(DWS) SQL Overview.

  8. After the authorization is complete, click Create.

Creating a Database User

You can use the DDL syntax or create a table on the GaussDB(DWS) console. For details about the DDL syntax, see "CREATE USER".

NOTE:
  • If the current console does not support this feature, contact technical support.
  • After a cluster is created, the users or roles created with it cannot be modified.
  • Before using this function, ensure that the cluster is available.
  1. Log in to the GaussDB(DWS) console. In the navigation pane, choose Dedicated Clusters > Clusters.
  2. In the cluster list, click the name of the target cluster. The cluster information page is displayed.
  3. In the navigation pane, choose User Management.
  4. On the Users page, click Create User.
  5. Set the parameters on the Configure Basic Settings page.

    Table 2 Parameters on the Configure Basic Settings page

    Parameter

    Description

    Example Value

    Username

    The value must start with a letter and can contain a maximum of 63 characters, including letters, digits, and underscores (_).

    DWS-demo

    Password

    Enter a value that is 12 to 32 characters long and can contain letters, digits, underscores (_), and special characters.

    NOTE:

    Your password must contain a minimum of three of the following character types: uppercase letters, lowercase letters, digits, and special characters (~!?,.:;_(){}[]/<>@#%^&*+|\=-)

    -

    Maximum Connections

    Maximum number of connections between the user and the database. The value -1 indicates that the number of connections is not limited.

    -1

    Expires

    Expiration time of the user's permissions.

    -

    System Administrator

    Whether the user is a system administrator.

    -

    Create Database

    Whether the user has the permission to create databases.

    -

    Create Role

    Whether the user has the permission to create users and roles.

    -

    Inherit Permissions

    Whether the user inherits permissions from its user group. By default, this function is enabled and it is best to keep it that way.

    -

  6. Confirm the settings and click Next.
  7. On the Configure Roles page, select the role to be assigned to the user and click Next.
  8. Configure permissions not included in the roles of the user.

    Click Add to add a permission configuration. Select the database object type and corresponding database object, and select the permission to complete assignment. For details about permission definitions, see "DCL Syntax" > "GRANT" in GaussDB(DWS) SQL Overview.

  9. After the authorization is complete, click Create.

Modifying a User

  1. Log in to the GaussDB(DWS) console. In the navigation pane, choose Dedicated Clusters > Clusters.
  2. In the cluster list, click the name of the target cluster. The cluster information page is displayed.
  3. In the navigation pane, choose User Management.
  4. In the user list, select a user and click Modify. The page for modifying user details is displayed.
  5. Modify the user information. For details, see Table 2. After confirming that the information is correct, click Next.
  6. Select the role to be granted to the user and click Next.
  7. After selecting a permission type, you can click Edit in the Operation column and click Modify in the Permission column to add or remove a permission.

  8. Confirm the permissions. Click Save.

Deleting a User

Prerequisites

To prevent any problems with deleting a user, check for dependencies between database objects (such as tables) beforehand. If there are any dependencies, delete them first before proceeding with the user deletion.

Procedure

  1. Log in to the GaussDB(DWS) console. In the navigation pane, choose Dedicated Clusters > Clusters.
  2. In the cluster list, click the name of the target cluster. The cluster information page is displayed.
  3. In the navigation pane, choose User Management.
  4. Select a user from the user list and click Delete. A confirmation dialog box is displayed. If you select Forcibly delete and remove dependencies, tables and other database objects under the current user will be transferred to the administrator account.
  5. Click OK.

Exporting a User

  1. Log in to the GaussDB(DWS) console. In the navigation pane, choose Dedicated Clusters > Clusters.
  2. In the cluster list, click the name of the target cluster. The cluster information page is displayed.
  3. In the navigation pane, choose User Management.
  4. Click Export in the upper part of the user list and select the number of records to be exported to export the user list.

    Figure 1 Exporting a user

  5. Confirm the configurations and click Export.

Exporting User Permissions

  1. Log in to the GaussDB(DWS) console. In the navigation pane, choose Dedicated Clusters > Clusters.
  2. In the cluster list, click the name of the target cluster. The cluster information page is displayed.
  3. In the navigation pane, choose User Management.
  4. Select a user from the user list and click Export Permissions to export the user permission list.

    Figure 2 Exporting permissions

Modifying a Role

  1. Log in to the GaussDB(DWS) console. In the navigation pane, choose Dedicated Clusters > Clusters.
  2. In the cluster list, click the name of the target cluster. The cluster information page is displayed.
  3. In the navigation pane, choose User Management.
  4. In the role list, select a user and click Modify. The page for modifying role details is displayed.
  5. Modify the role information. For the parameter description, see Table 1.
  6. Confirm the settings and click Next.
  7. Configure permissions. Select a permission type as required, click Edit in the Operation column, and click Modify in the Permission column to add or remove permissions.
  8. Confirm the permissions. Click Save.

Deleting a Role

Prerequisites

To prevent any problems with deleting a role, check for dependencies such as database objects beforehand. If there are any dependencies, delete them first before proceeding with the role deletion.

Procedure

  1. Log in to the GaussDB(DWS) console. In the navigation pane, choose Dedicated Clusters > Clusters.
  2. In the cluster list, click the name of the target cluster. The cluster information page is displayed.
  3. In the navigation pane, choose User Management.
  4. Select a role from the role list and click Delete. A confirmation dialog box is displayed.
  5. Click OK to delete the role.

Exporting Roles

  1. Log in to the GaussDB(DWS) console. In the navigation pane, choose Dedicated Clusters > Clusters.
  2. In the cluster list, click the name of the target cluster. The cluster information page is displayed.
  3. In the navigation pane, choose User Management and click Roles to switch to the role list page.
  4. Click Export in the upper part of the role list and select the number of roles to be exported.

    Figure 3 Exporting roles

  5. Confirm the information and click Export.

Exporting Role Permissions

  1. Log in to the GaussDB(DWS) console. In the navigation pane, choose Dedicated Clusters > Clusters.
  2. In the cluster list, click the name of the target cluster. The cluster information page is displayed.
  3. In the navigation pane, choose User Management and click Roles to switch to the role list page.
  4. Select a user from the role list, click Export Permissions, and select the number of records to be exported.

    Figure 4 Exporting role permissions

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback