Creating a Database
Scenarios
After a GaussDB(for MySQL) instance is created, you can create databases on it.
Constraints
- This operation is not allowed when another operation is being performed on your DB instance.
- After a database is created, the database name cannot be changed.
Method 1: Creating a Database on the GaussDB(for MySQL) Console
- Log in to the management console.
- Click in the upper left corner and select a region and project.
- Click in the upper left corner of the page and choose Databases > GaussDB(for MySQL).
- On the Instances page, click the instance name.
- In the navigation pane, choose Databases.
- In the displayed dialog box, set the required parameters and click OK.
Figure 1 Creating a database
Table 1 Parameter description Parameter
Description
Database Name
The database name can consist of 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. The total number of hyphens (-) cannot exceed 10.
Character Set
Select a character set as required.
User
- You can select one or more unauthorized users. If there are no unauthorized users, you can create one.
- If you require fine-grained permissions control, log in to the DAS console.
Remarks
The remarks can consist of up to 512 characters. It cannot contain carriage returns or any of the following special characters: !<"='>&
- After the database is created, authorize or delete it on the Databases page. You can search for the desired database by character set and database name.
Method 2: Creating a Database Through DAS
- Log in to the management console.
- Click in the upper left corner and select a region and project.
- Click in the upper left corner of the page, choose .
- On the Instances page, locate an instance and click Log In in the Operation column.
- On the displayed DAS login page, enter the username and password and click Log In.
- Create a database using either of the following methods:
- On the home page, click Create Database. In the displayed dialog box, set the database name, character set, and collation, and click OK.
Figure 2 Creating a database
- Choose SQL Operations > SQL Query. In the displayed SQL window, select the target database and run the following command:
create database database_name;
- On the home page, click Create Database. In the displayed dialog box, set the database name, character set, and collation, and click OK.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot