Help Center/
Relational Database Service/
Getting Started/
Getting Started with RDS for MariaDB/
Example: Buy and Connect to an RDS for MariaDB Instance
Updated on 2024-04-11 GMT+08:00
Example: Buy and Connect to an RDS for MariaDB Instance
This example illustrates how to purchase an RDS for MariaDB instance and connect to it from a Linux ECS over a private network.
- Step 1: Buy an RDS for MariaDB Instance
- Step 2: Buy an ECS
- Step 3: Connect to the RDS for MariaDB Instance
Figure 1 Example diagram
Step 1: Buy an RDS for MariaDB Instance
- Go to the Buy DB Instance page.
- Configure the instance information and click Next. Keep the region, AZ, VPC, and security group of the DB instance the same as those of the ECS.
Figure 2 Selecting an engine version
Figure 3 Selecting an instance class
Figure 4 Configuring network information
Figure 5 Setting a password
- View the purchased RDS instance.
Figure 6 Instance successfully purchased
Step 2: Buy an ECS
- Go to the Buy ECS page.
- Configure basic settings and click Next: Configure Network. Keep the region and AZ of the ECS the same as those of the RDS for MariaDB instance to be connected.
Figure 7 Basic configurations
Figure 8 Selecting an image
- Configure the ECS network information and click Next: Configure Advanced Settings. Keep the VPC and security group of the ECS the same as those of the RDS for MariaDB instance to be connected.
Figure 9 Network settings
Figure 10 Selecting an EIP
- Configure the ECS password and click Next: Confirm.
Figure 11 Advanced settings
- Confirm the configurations and click Submit.
Figure 12 Confirming the configurations
- View the purchased ECS.
Step 3: Connect to the RDS for MariaDB Instance
- Use a Linux remote connection tool (for example, MobaXterm) to log in to the ECS. Enter the EIP bound to the ECS for Remote host.
Figure 13 Creating a session
- Enter the password of the ECS.
Figure 14 Entering the password
Figure 15 Successful login
- Install a MariaDB client by following the instructions provided in the official documentation.
In CentOS, for example, run the following statement:
yum install MariaDB-client
Figure 16 Installing a client
- Connect to the RDS for MariaDB instance.
mysql -h ip -P 3306 -u root -p
Figure 17 Connection succeeded
- Create a database, for example, mydb.
create database mydb;
Figure 18 Creating a database
- Create a table, for example, my_table.
create table my_table(id int);
Figure 19 Creating a table
Parent topic: Getting Started with RDS for MariaDB
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot