Getting started

Prev Next

Available in Classic

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 Classic 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 Classic environment of the NAVER Cloud Platform console, you need to set up a port forwarding.

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 port forwarding

The following describes how to set port forwarding in the Classic environment:

  1. In the Classic environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Compute > Server.
  2. Select the server you want to set up the port forwarding, and click [Set port forwarding].
  3. Enter the external port number you want to set, and click [Add].
    • You can enter 1,024 to 65,534 for the external ports. This external port can only be used to access the server.
  4. Click [Apply].

Get admin password

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

  1. In the Classic 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.

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 Classic environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Compute > Server.
  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 Classic environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Compute > Server.
  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>