MySQL(DBaaS) Server Connection
Scenario Overview
MySQL(DBaaS) Server Connection scenario involves creating a Bastion host (Virtual Server) and a Database service, and accessing the DB service through the Bastion host. To reliably connect to MySQL (DBaaS) in the Samsung Cloud Platform environment, you need to create a Bastion host and establish a network connection using it. To maintain stability and a high level of security, it is recommended to configure the Database service in a Private Subnet environment and place the Bastion host in a restricted Public Subnet environment.
This scenario primarily describes creating a Bastion host and a Database service, configuring the network environment for Bastion host and Database access, and connecting through a DB client.
Scenario components
You can build 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 lets users subdivide the network within a VPC to match their purpose and scale. | |
| Networking | VPC > Public IP | A service that reserves a public IP and allocates and releases it to Compute resources | |
| Networking | VPC > Internet Gateway | A service that connects VPC resources to the Internet | |
| Networking | Security Group | Virtual firewall that controls server 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 the Virtual Server |
- Since the default policy of a Security Group is Deny All, you must register only the allowed IPs.
- The All Open (Any IP, Any Port) policy for In/Outbound can expose cloud resources directly to external threats.
- By specifying the required IP and port and setting a policy, you can strengthen security.
Scenario configuration method
Create the services needed to build the scenario by following the steps below.
Set up the network
Describes the process of configuring the network environment for accessing the Bastion Host and Database services.
1-1. Create VPC
- Click the All Services > Networking > VPC menu. You will be taken to the VPC’s Service Home page.
- Click the VPC Creation button on the Service Home page. You will be taken to the VPC Creation page.
- On the VPC Creation page, enter the information required to create the service.
- Enter the IP range as
192.168.x.0/16.
- Enter the IP range as
- Summary Check the detailed information and estimated billing amount generated in the panel, and click the Complete button.
- Once creation is complete, check the created resources on the VPC List page.
1-2. Create Subnet
- Click the All Services > Networking > VPC menu. You will be taken to the VPC Service Home page.
- On the Service Home page, click the Subnet menu. You will be taken to the Subnet List page.
- Click the Create Subnet button. You will be taken to the Create Subnet page.
- On the Subnet Creation page, enter the information required to create the service.
- Select the Subnet type as General.
- Select a pre‑created VPC.
- Enter the IP range as
192.168.x.0/24.
- Summary Check the detailed information and estimated billing amount generated in the panel, and click the Complete button.
- When creation is complete, verify the created resources on the Subnet list page.
1-3. Create Internet Gateway
- Click the All Services > Networking > VPC menu. Go to the VPC’s Service Home page.
- On the Service Home page, click the Internet Gateway menu. You will be taken to the Internet Gateway List page.
- Click the Create Internet Gateway button. You will be taken to the Create Internet Gateway page.
- On the Internet Gateway Creation page, enter the required information to create the service.
- Select a pre‑created VPC.
- In the Firewall usage option, select Use.
- Summary Check the detailed information and estimated billing amount generated in the panel, and click the Complete button.
- Once creation is complete, check the created resource on the Internet Gateway List page.
1-4. Create Public IP
- Click the All Services > Networking > VPC menu. Navigate to the VPC’s Service Home page.
- On the Service Home page, click the Public IP menu. You will be taken to the Public IP List page.
- Click the Public IP Reservation button. You will be taken to the Public IP Reservation page.
- On the Public IP reservation page, enter the required information to reserve the service.
- In the Summary panel, verify the detailed information and estimated billing amount you generated, and click the Complete button.
- When creation is complete, check the created resources on the Public IP List page.
1-5. Create Security Group
- Click the All Services > Networking > Security Group menu. You will be taken to the Service Home page of the Security Group.
- Click the Create Security Group button on the Service Home page. You will be taken to the Create Security Group page.
- On the Security Group creation page, enter the required information for creating the service.
- Check the input information and click the Complete button.
- When creation is complete, verify the created resource on the Security Group List page.
Create Bastion host
This explains the process of configuring a Bastion Host where the Database access client must be installed.
2-1. Create Server Keypair
- Click the All Services > Compute > Virtual Server menu. Navigate to the Service Home page of Virtual Server.
- On the Service Home page, click the Keypair menu. You will be taken to the Keypair List page.
- Click the Create Keypair button. You will be taken to the Create Keypair page.
- Enter the required information needed to create a service on the Keypair creation page.
- Check the creation information and click the Complete button.
- The key can be downloaded only on the first attempt, and reissuance is not available.
- Please store the downloaded key in a secure location.
2-2. Create Bastion host
- Click the All Services > Compute > Virtual Server menu. Navigate to the Service Home page of Virtual Server.
- On the Service Home page, click the Create Virtual Server button. You will be taken to the Create Virtual Server page.
- On the Virtual Server Creation page, enter the required information to create the service.
- Select Windows for the image.
- Select the pre-created VPC and Subnet.
- Click Use NAT, then select the reserved Public IP from 1-4. Create Public IP.
- Connect the Keypair created in 2-1. 서버 Keypair 생성하기.
- Summary Check the detailed information and estimated billing amount generated in the panel, and click the Complete button.
- After creation is complete, check the created resources on the Virtual Server List page.
2-3. Bastion host Check login ID and PW
- Click the All Services > Compute > Virtual Server menu. Navigate to the Service Home page of Virtual Server.
- On the Service Home page, click the Virtual Server menu. You will be taken to the Virtual Server List page.
- On the Virtual Serve List page, click the resource you created in [2-2. Bastion host creation]. You will be taken to the detailed information page of that resource.
- On the detail page, click the RDP password view button in the Keypair name field. The RDP password view popup will open.
- In the RDP password lookup popup window, attach the keypair file downloaded from 2-1. 서버 Keypair 생성하기.
- After attaching, click the Password Check button. The ID and Password for accessing the resource are displayed.
- The ID and password will later be used as credentials to access the Bastion host in 5-1. Bastion host Connecting.
Create Database
Explains the process of creating a Database service.
3-1. Create MySQL(DBaaS) Service
- Click the All Services > Database > MySQL(DBaaS) menu. Go to the Service Home page of MySQL(DBaaS).
- On the Service Home page, click the MySQL(DBaaS) Create button. You will be taken to the MySQL(DBaaS) Create page.
- On the MySQL(DBaaS) Creation page, enter the required information needed to create the service.
- Select the pre‑created VPC and Subnet and connect them.
- Enter the database-related creation details on the required information input screen.
- Add the Bastion host IP in the IP access control settings.
- The Database Port defaults to 2866, but the user can also specify it.
- Summary Check the detailed information and estimated billing amount generated in the panel, and click the Complete button.
- Once creation is complete, check the created resource on the MySQL(DBaaS) list page.
Configure Rules
It explains the process of configuring rules for a user to connect to the Bastion host and rules for connecting to the Database from the Bastion host.
4-1. Adding security rules to Security Group
- Click the All Services > Networking > Security Group menu. Go to the Service Home page of Security Group.
- Click the Security Group menu on the Service Home page. You will be taken to the Security Group List page.
- Select the Security Group resource created in 1-5. Create Security Group. Navigate to the detailed information page for that resource.
- Click the Rules tab on the detail page. You will be taken to the Rules tab.
- On the Rules tab, click the Add Rule button. The Add Rule popup will appear.
- Add Rule In the popup window, enter the rule below, and click the Confirm button.
direction remote Target address Protocol Port Explanation Inbound CIDR User PC IP TCP 3389 (RDP) Bastion client PC → Bastion host Outbound CIDR DB IP TCP Database Port (manual entry) Bastion host → Database Table. Security Group rules that need to be added
4-2. Adding IGW Firewall Rule
- All Services > Networking > Firewall Click the menu. Go to the Service Home page of the Firewall.
- On the Service Home page, click the Firewall menu. You will be taken to the Firewall List page.
- On the Firewall List page, select the Internet Gateway resource name created in 1-3. Create Internet Gateway. You will be taken to the detailed information page of that resource.
- Click the Rules tab on the detail page. You will be taken to the Rules tab.
- Click the Add Rule button on the Rules tab. You will be taken to the Add Rule popup.
- Add Rule In the popup window, enter the rule below, and click the Confirm button.
origin address Destination address Protocol Port operation direction Explanation Bastion connection PC IP Bastion host IP TCP 3389(RDP) Allow Inbound User PC → Bastion host Table. Internet Gateway Firewall rules that should be added
Connect to Database
Describes the process of a user accessing the database via a DB client program.
This guide explains how to connect using MySQL Workbench. Since there are various database client programs and CLI utilities, you may install and use the tool that best fits your needs.
5-1. Connecting to Bastion host
- In the Windows environment of the PC that will connect to the Bastion host, run Remote Desktop Connection, then enter the NAT IP of the Bastion Host and click the Connect button.
- When the remote desktop connection succeeds, the user credential input window opens. Enter the ID and Password verified in 2-3. Check the Bastion host access ID and PW and click the Confirm button.
5-2. Install DB access client program (MySQL Workbench) on the Bastion host
- Visit the official MySQL page and download the MySQL Workbench program.
- MySQL Workbench program download URL: https://dev.mysql.com/downloads/workbench
- Connect the user’s PC hard drive to upload the file to the Bastion host.
- In the Local Resources tab of the Remote Desktop Connection, click the Details button of the Local Devices and Resources item.
- Select the local disk where the file was downloaded on the drive, and click the OK button.
- Copy the downloaded file, upload it to the Bastion Host, and click the MySQL Workbench installer to install.
5-3. Connect to the Database using the DB client program (MySQL Workbench)
- Launch MySQL Workbench and click Database > Manage connections. The Manage Server Connection popup appears.
- Manage Server Connection In the popup window, click the New button at the lower left, enter the Database server information created in 3-1. MySQL(DBaaS) 서비스 생성하기, and click the Test Connection button. A Password popup will appear.
Required input field input value Connection Name Custom (ex. service name) Host name Database server IP Port Database Port Username Database username Table.DB connection client program input fields - In the Password popup, enter the password you set in 3-1. MySQL(DBaaS) Create Service and click the OK button. When the operation completes successfully, click the OK button in the Manage Server Connection popup.
- Click Database > Connect to Database. The Connect to Database popup appears.
- Select the Connection Name registered in Stored Connection to perform a Database connection. After connecting, you can try simple Query, etc.
