Getting started

Prev Next

Available in VPC

This guide describes what you need to do to properly use Cloud DB for MySQL after checking the Cloud DB for MySQL user environment and supported specifications and fully understanding the Quickstart and Glossary. The following is the content dealt with in this guide:

  • How to create an application server from the NAVER Cloud Platform console.
  • How to test application server connection.
  • How to create MySQL Server from the NAVER Cloud Platform console.
  • How to test MySQL Server connection.

If you completed the above, then you have completed the basic procedure for using Cloud DB for MySQL. Afterward, you have the option of proceeding with the following tasks for more efficient server management and operation:

  • Event and notification (alarm) settings using NAVER Cloud Platform's Cloud Insight.
  • Permissions management for using NAVER Cloud Platform's Sub Account.
  • Storage of log files and backup files using NAVER Cloud Platform's Object Storage.
  • Setting DB server read load balancing using NAVER Cloud Platform's Load Balancer.

The above tasks can be done from Cloud Insight, Sub Account, Object Storage, and Load Balancer after subscribing, rather than in Cloud DB for MySQL. They are not explained in detail in this guide. For detailed instructions, see Cloud Insight user guide, Sub Account user guide, Object Storage user guide, and Load Balancer user guide.

Create application server

To create an application server from the NAVER Cloud Platform console, follow these steps:

Note

In this section, we will briefly introduce how to create an application server. For more information on full creation methods, see the following guide:

  1. Access the NAVER Cloud Platform console.
  2. Click Region and Platform at the top right of the console interface.
  3. Select your Region and VPC platform and click [Apply].
  4. Click i_menu at the top left of the console interface.
  5. Click Services > Compute > Server menu in order.
  6. Click [Create server].
  7. Select the server image and click [Next].
  8. Enter the required information, and click [Next].
  9. If you do not have an existing authentication key, then create a new authentication key and click [Next].
  10. If you do not have any ACG, create a new one.
  11. After the final confirmation, click [Create server].
Caution

The ACG name of the application server from step 7 is used when adding ACG to the MySQL Server later on.

Set access environment

To set up a server access environment in the VPC environment of the NAVER Cloud Platform console, you need to set up a public IP.

Note

In this section, we will briefly introduce how to set up the access environment. For more information on setting up the access environment, see the following guide:

Set public IP

To set up a public IP, follow these steps:

  1. In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Compute > Server.
  2. Click Public IP.
  3. Click [Request public IP].
  4. Select the target server, enter a memo, and click [Next].
  5. Click [Create].

Get admin password

To get the admin (root) password required for accessing the application server after setting up the public IP, follow these steps:

  1. In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Compute > Server.
  2. Click [Manage servers and change settings], and click the Get admin password menu.
  3. Enter the authentication key generated while creating the server.
  4. Click [Check password].
  5. Check the password.

Set SSL VPN

You can allow external access to the MySQL Server to be created by using SSL VPN through the following steps:

1. Create SSL VPN
2. Add VPN range to Subnet's Route Table
3. Set MySQL Server's ACG
4. Set MySQL Server's DB USER
5. Check access information of MySQL Server

1. Create SSL VPN

To create an SSL VPN, follow these steps:

  1. In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Security > SSL VPN.
  2. Click [Request for an SSL VPN].
  3. When the Create SSL VPN popup window appears, enter the required information, and click [Create].
  4. After creation, check the SSL VPN IP address range from the delivered email or the SSL VPN interface of the console.

2. Add VPN range to Subnet's Route Table

To add a VPN range to the subnet's route table, follow these steps:

  1. In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Database > Cloud DB for MySQL.
  2. Click Route Table.
  3. Register the range of each SSL VPN to the route table of the subnet to be used.
  4. Click and select the route table to set up, and click [Set routes].
  5. When the Set Route Table popup window appears, enter the required information.
    • Destination: SSL VPN's IP pool
    • Target Type: SSL VPN
    • Target name: the name of the created SSL VPN
  6. Click [OK].

3. Set MySQL Server's ACG

The following describes how to set up a MySQL Server's ACG:

  1. In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Database > Cloud DB for MySQL.
  2. Click the DB Server menu.
  3. From the details interface of the server to be configured, click the clouddbforpg_ico button of the ACG.
  4. Click [Set ACG].
  5. Add settings to allow SSL VPN access.
    • Access source: the IP address bandwidth of SSL VPN
    • Allowed port: DB Server port
  6. Click [Apply].

4. Set MySQL Server's DB USER

The following describes how to set up MySQL Server's DB USER:

  1. In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Database > Cloud DB for MySQL.
  2. Click the DB Server menu.
  3. Click to select the server to configure, and click Manage DB > Manage DB User, in order.
  4. Add DB User to allow access from the VPN bandwidth.
  5. Click [Save].

5. Check access information of MySQL Server

After completing the external access settings using SSL VPN, check the access information of the MySQL Server. To check them, follow these steps:

  1. In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Database > Cloud DB for MySQL.
  2. Click the DB Server menu.
  3. Click to select the server you want to check, and check the necessary information from the View details interface.
    • Private domain: it is a domain that can only be accessed from the NAVER Cloud Platform servers, and is used similarly as the DB server host name.
    • DB access port

Test application server connection

You can use the terminal program, PuTTY, to test if you can properly connect to the application server, follow these steps:

  1. Run PuTTY.
  2. Enter the IP address and port number acquired from the access environment settings for Host Name (or IP address) and Port.
    clouddbformysql-start_01
  3. Click [Open].
  4. When the PuTTY Security Alert popup window appears, click [Accept].
    clouddbformysql-start_02
  5. When the cmd window for server access appears, enter the password you got from Get admin password.
    clouddbformysql-start_03
Note

You can change the password through the passwd command.

Create MySQL Server

Some of the services provided by NAVER Cloud Platform require you to go through the subscription procedure from the console before the start of actual usage. However, for Cloud DB for MySQL, you can start using it upon creation of an MySQL Server without a separate subscription step. The following describes how to create an MySQL Server from the NAVER Cloud Platform console:

Note
  • In this section, we will briefly introduce how to create a DB Server. For more information on full creation methods, see Create MySQL Server.
  • Since Cloud DB for MySQL does not require an additional subscription step, there is no separate procedure for canceling the subscription. If you want to stop using Cloud DB for MySQL and prevent charges from incurring, then delete the MySQL Server you created and were running. To delete MySQL Server, see Delete MySQL Server.
  1. In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Database > Cloud DB for MySQL.
  2. Click the DB Server menu.
  3. Click [Create DB Server].
  4. When the subscription interface appears, enter the required information and click [Next].
  5. Click [Create].

Set ACG

To set up the Access Control Group (ACG) for a MySQL Server from the NAVER Cloud Platform console, follow these steps:

Note

In this section, we will briefly introduce how to set up ACG. For more information on how to set ACG, see ACG user guide.

  1. In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Database > Cloud DB for MySQL.
  2. Click the ACG menu.
    clouddbformysql-start_acg_vpc_ko.png
  3. Click and select the ACG to set up, and click [Set ACG].
    • Select the ACG of the MySQL Server automatically created.
  4. Enter the ACG name of the application server in Access source.
  5. Enter the port number in Allowed port.
  6. Click [Add].
  7. Click [Apply].

Test MySQL Server connection

The following describes how to test if you can connect properly to the created MySQL Server by installing the MySQL client:

  1. Access the application server, run the following commands, and install MySQL.

    • CentOS 6.x or 6.x earlier
    [root@localhost ~] # yum -y install mysql mysql-server
    
    • CentOS 7.x - MySQL 5.7 version
    [root@localhost ~] # yum -y install https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
    [root@localhost ~] # rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
    [root@localhost ~] # yum -y install mysql-community-server
    [root@localhost ~] # mysqld --initialize-insecure --user=mysql
    [root@localhost ~] # systemctl start mysqld
    
    • CentOS 7.x - MySQL 8.0 version
    [root@localhost ~] # yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
    [root@localhost ~] # rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
    [root@localhost ~] # yum -y install mysql-community-server
    [root@localhost ~] # mysqld --initialize-insecure --user=mysql
    [root@localhost ~] # systemctl start mysqld
    
    • Rocky 8.x - 9.x version
    [root@localhost ~] # sudo dnf install -y mysql-server
    [root@localhost ~] # sudo systemctl start mysqld
    
    Note
    • Starting with CentOS 7, the default DB for MySQL installed with yum has changed to MariaDB, so you must run the above command to install it.
    • For MySQL 5.7 version, when restoring with Xtrabackup, you must add innodb_undo_tablespaces = 2 to the [mysqld] part of the my.cnf file before mysqld --initialize-insecure --user=mysql.
  2. Access the DB server by executing the following commands.

    • You can check port number, user ID, and password required for DB access from the DB Server menu on the NAVER Cloud Platform console.
    [root@localhost ~] # mysql -h ① Private domain name -u ②user_id -p --port ③DB access port
    
    -- Access success examples
    
    [root@localhost ~] # mysql -h db-gmcp.beta-cdb.ntruss.com -umysql_dba -p --port 3306
    Enter password: **********
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 17199
    Server version: 5.7.19-log MySQL Community Server (GPL)
    
    Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql>