MySQL(DBaaS) server connection
Scenario Overview
The MySQL(DBaaS) server connection scenario is a scenario where a Bastion host (Virtual Server) and Database service are created, and the DB service is accessed through the Bastion host. To connect to MySQL(DBaaS) stably in the Samsung Cloud Platform environment, it is necessary to create a Bastion host and use it for network connection. To maintain a stable and high level of security, it is recommended to configure the Database service in a Private Subnet environment and configure the Bastion host in a limited Public Subnet environment.
This scenario largely describes the process of creating a Bastion host and Database service, and configuring the network environment for Bastion host and Database connection, so that it can be accessed through a DB connection client.
Scenario Components
You can configure the scenario using the following services.
| Service Group | Service | Detailed Description | |
|---|---|---|---|
| Networking | VPC | A service that provides an isolated virtual network in a cloud environment | |
| Networking | VPC > Subnet | A service that allows users to subdivide the network into smaller sections for specific purposes/sizes within the VPC | |
| Networking | VPC > Public IP | A service that reserves a public IP and assigns and returns it to Compute resources | |
| Networking | VPC > Internet Gateway | A service that connects VPC resources to the internet | |
| Networking | Security Group | A virtual firewall that controls the server’s traffic | |
| Database | MySQL(DBaaS) | A service that easily creates and manages MySQL in a web environment | |
| Compute | Virtual Server | Virtual server optimized for cloud computing | |
| Compute | Virtual Server > Keypair | Encryption file used to connect to Virtual Server |
Scenario composition method
To configure the scenario, create the necessary services through the following procedure.
1. Configuring the Network
This explains the process of configuring the network environment for Bastion Host and Database service connection.
1-1. Creating a VPC
- Click All services > Networking > VPC menu. It moves to the Service Home page of VPC.
- On the Service Home page, click the Create VPC button. It moves to the Create VPC page.
- VPC Creation page, please enter the information needed to create the service.
- IP range should be entered as
192.168.x.0/16.
- IP range should be entered as
- In the Summary panel, review the detailed information and estimated charge, then click the Complete button.
- Once the creation is complete, check the created resource on the VPC list page.
1-2. Creating a Subnet
- Click All services > Networking > VPC menu. It moves to the Service Home page of VPC.
- Service Home page, click the Subnet menu. It moves to the Subnet list page.
- Click the Subnet Creation button. It moves to the Subnet Creation page.
- Subnet creation page where you enter the information needed to create a service.
- Subnet type should be selected as General.
- Please select a pre-created VPC.
- IP range should be entered as
192.168.x.0/24.
- In the Summary panel, review the detailed information and estimated charges, then click the Complete button.
- After creation is complete, check the created resource on the Subnet list page.
1-3. Creating an Internet Gateway
- Click All services > Networking > VPC menu. It moves to the Service Home page of VPC.
- Service Home page, click the Internet Gateway menu. It moves to the Internet Gateway list page.
- Click the Create Internet Gateway button. It moves to the Create Internet Gateway page.
- Internet Gateway creation page, please enter the required information necessary for service creation.
- Please select a pre-created VPC.
- Select use in the Firewall usage item.
- In the Summary panel, review the detailed information and estimated charges, then click the Complete button.
- Once the creation is complete, check the created resource on the Internet Gateway list page.
1-4. Creating a Public IP
- Click All services > Networking > VPC menu. It moves to the Service Home page of VPC.
- Click the Public IP menu on the Service Home page. It moves to the Public IP list page.
- Public IP Reservation button, click. Move to the Public IP Reservation page.
- Public IP Reservation page where you enter the required information necessary for service reservation.
- Check the detailed information generated in the Summary panel and the expected bill amount, and click the Complete button.
- After creation is complete, check the created resource on the Public IP List page.
1-5. Creating a Security Group
- Click the menu for all services > Networking > Security Group. It moves to the Service Home page of Security Group.
- Click the Security Group Creation button on the Service Home page. It moves to the Security Group Creation page.
- Security Group creation page where you enter the required information necessary for service creation.
- Check the input information and click the Complete button.
- Once creation is complete, check the created resource on the Security Group list page
2. Creating a Bastion Host
This describes the process of configuring the Bastion Host where the database connection client should be installed.
2-1. Creating a Server Keypair
- Click All Services > Compute > Virtual Server menu. It moves to the Service Home page of Virtual Server.
- Click the Keypair menu on the Service Home page. It moves to the Keypair list page.
- Keypair creation button should be clicked. It moves to the Keypair creation page.
- Keypair creation page, please enter the required information necessary for service creation.
- Check the creation information and click the Complete button.
- The key can only be downloaded for the first time, and re-issuance is not provided.
- Please keep the downloaded key in a safe place.
2-2. Creating a Bastion Host
- Click All Services > Compute > Virtual Server menu. It moves to the Service Home page of Virtual Server.
- Click the Virtual Server Creation button on the Service Home page. It moves to the Virtual Server Creation page.
- Virtual Server Creation page, please enter the required information necessary for service creation.
- The image is Windows, please select.
- Please select the pre-created VPC and Subnet.
- Click NAT Use and select the Public IP reserved in 1-4. Creating Public IP.
- 2-1. Creating a server Keypair Connect the Keypair created from
- Summary panel, check the detailed information generated and the expected billing amount, and click the Complete button.
- Once creation is complete, check the created resource on the Virtual Server list page.
2-3. Check Bastion host connection ID and PW
- Click All Services > Compute > Virtual Server menu. It moves to the Service Home page of Virtual Server.
- Service Home page, click the Virtual Server menu. Move to the Virtual Server list page.
- Virtual Serve list page, click on the resource created in 2-2. Creating a Bastion host. It moves to the detailed information page of the corresponding resource.
- Click the RDP password inquiry button in the Keypair item on the detailed information page. The RDP password inquiry popup window opens.
- RDP password inquiry popup window, attach the keypair file downloaded from 2-1. Creating a server keypair.
- After attaching, click the Password Check button. The ID and password required to access the resource will be displayed.
- The ID and Password will be used as information to access the Bastion host later in 5-1. Bastion host 접속하기.
3. Creating a Database
It describes the process of creating a database service.
3-1. Creating a MySQL (DBaaS) Service
- Click on the menu for all services > Database > MySQL(DBaaS). It moves to the Service Home page of MySQL(DBaaS).
- On the Service Home page, click the Create MySQL(DBaaS) button. It moves to the Create MySQL(DBaaS) page.
- MySQL(DBaaS) creation page, please enter the required information needed for service creation.
- Select and connect the pre-created VPC and Subnet.
- Enter database-related creation information on the required information input screen.
- Add the Bastion host IP to the IP access control item.
- Database Port is 2866 by default, but you can specify it as you want.
- In the Summary panel, review the detailed information and estimated charges, then click the Complete button.
- Once the creation is complete, check the created resource on the MySQL(DBaaS) list page.
4. Setting Rules
This explains the process of setting rules for users to access the Bastion host and rules for the Bastion host to access the Database.
4-1. Adding Security Group Security Rules
- Click the menu for all services > Networking > Security Group. It moves to the Service Home page of Security Group.
- Service Home page, click the Security Group menu. Move to the Security Group list page.
- 1-5. Creating a Security Group Select the Security Group resource created from. It will move to the detailed information page of the corresponding resource.
- Click the Rules tab on the detailed information page. It moves to the Rules tab.
- Click the Rule tab and click the Add Rule button. It moves to the Add Rule popup window.
- Add Rule popup window, enter the rules below, and click the OK button
| Direction | Remote | Destination Address | Protocol | Port | Description |
|---|---|---|---|---|---|
| Inbound | CIDR | User PC IP | TCP | 3389 (RDP) | Bastion connection PC → Bastion host |
| Outbound | CIDR | DB IP | TCP | Database Port (direct input) | Bastion host → Database |
4-2. Adding IGW Firewall Rules
- Click All services > Networking > Firewall menu. It moves to the Service Home page of Firewall.
- Service Home page, click the Firewall menu. It moves to the Firewall list page.
- Firewall list page, select the Internet Gateway resource name created in 1-3. Creating Internet Gateway, and move to the detailed information page of the corresponding resource.
- Click the Rules tab on the detailed information page. It moves to the Rules tab.
- Click the Rule tab and click the Add Rule button. It moves to the Add Rule popup window.
- Add Rule In the popup window, enter the rules below and click the OK button.
| Departure Address | Destination Address | Protocol | Port | Action | Direction | Description |
|---|---|---|---|---|---|---|
| Bastion connection PC IP | Bastion host IP | TCP | 3389(RDP) | Allow | Inbound | User PC → Bastion host |
| Fig. Internet Gateway Firewall rules to be added |
5. Connect to Database
This describes the process of a user accessing the Database through a DB connection client program.
This guide provides instructions on how to connect using MySQL Workbench. There are various database client programs and CLI utilities, so you can install and use the tools that suit you.
5-1. Connecting to the Bastion host
- Run Remote Desktop Connection in the Windows environment of the PC you want to access the Bastion host, enter the NAT IP of the Bastion Host, and click the Connect button.
- After a successful remote desktop connection, the User Credential Input Window opens. Enter the ID and Password confirmed in 2-3. Checking Bastion Host Access ID and PW and click the Confirm button.
5-2. Install DB connection client program (MySQL Workbench) on the Bastion host
- Go to the official MySQL page and download the MySQL Workbench program.
- MySQL Workbench program download path: https://dev.mysql.com/downloads/workbench
- Connect the hard drive of the user’s PC to upload the file to the Bastion host.
- Click the Details button for local devices and resources entries in the Local Resources tab of Remote Desktop Connection.
- Select the local disk where the file was downloaded to the drive and click the Confirm button.
- Copy the downloaded file and upload it to the Bastion Host, then click the MySQL Workbench installation file to install it.
5-3. Using DB connection client program (MySQL Workbench) to connect to the Database
- Run MySQL Workbench and click Database > Manage connections. The Manage Server Connection popup window will appear.
- Manage Server Connection popup window, click the New button at the bottom left and enter the database server information created in 3-1. MySQL(DBaaS) service creation, then click the Test Connection button. A Password popup window will appear.
Required Input Element Items Input Value Connection Name Custom (ex. Service Name) Host name Database server IP Port Database Port Username Database username DB connection client program input items - Password popup window, enter the password set in 3-1. MySQL(DBaaS) service creation and click the OK button. When the success is complete, click the OK button in the Manage Server Connection popup window.
- Database > Connect to Database should be clicked. The Connect to Database popup window will appear.
- Select the Connection Name registered in Stored Connection to perform database connection. After connection, you can try simple queries, etc.
