Getting started with Cloud DB for MySQL
    • PDF

    Getting started with Cloud DB for MySQL

    • PDF

    Article Summary

    The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.

    Available in Classic and VPC

    The Getting started with Cloud DB for MySQL guide describes what you need to do to properly use Cloud DB for MySQL after checking the Cloud DB for MySQL use environment and supported specifications and fully understanding the Overall usage scenario and Glossary. The items described in Getting started with Cloud DB for MySQL are as follows.

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

    If you completed the above, then you've 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 settings using NAVER Cloud Platform's Cloud Insight
    • Management of administration permissions using NAVER Cloud Platform's Sub Account
    • Storage of log files and backup files using NAVER Cloud Platform's Object Storage
    • DB server's read load balancing settings using NAVER Cloud Platform's Load Balancer

    These tasks can be done after requesting subscription for Cloud Insight, Sub Account, Object Storage, and Load Balancer, rather than in Cloud DB for MySQL, and they are not explained in detail in this guide. For detailed instructions, please refer to the Cloud Insight Guide, Sub Account Guide, Object Storage Guide, and Load Balancer Guide.

    Create application server

    The following describes how to create an application server from the NAVER Cloud Platform console.

    Note

    In this section, we will briefly introduce how to create an application server. For details about full creation methods, please refer to the following guides.

    1. Please connect to the NAVER Cloud Platform console.
    2. Click the Services > Compute > Server menus, in that order.
    3. Click the [Create server] button.
    4. Select the server image and click the [Next] button.
    5. Enter the required information, and then click the [Next] button.
    6. If you do not have an existing authentication key, then create a new authentication key and click the [Next] button.
    7. If you do not have any ACGs, then create a new ACG.
    8. After the final confirmation, click the [Create server] button.
    Caution

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

    Set access environment (VPC)

    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.

    Caution

    In this section, we will briefly introduce how to set up the access environment. For details about setting up access environment, please refer to the following guide.

    Set public IP (VPC)

    The following describes how to set up a public IP in the VPC environment.

    1. Please connect to the NAVER Cloud Platform console.
    2. Click VPC from the Platform menu to switch to the VPC environment.
    3. Click the Services > Compute > Server menus, in that order.
    4. Click the Public IP menu.
    5. Click the [Request for public IP] button.
    6. Select the target server, enter notes, and then click the [Next] button.
    7. Click the [Create] button.

    Get admin password (VPC)

    After setting up the public IP, you can get the admin (root) password required for accessing the application server through the following steps:

    1. From the NAVER Cloud Platform console's VPC environment, click the Services > Compute > Server menus, in that order.
    2. Click the [Manage servers] button, and then click the Get admin password menu.
    3. Enter the authentication key generated while creating the server.
    4. Click the [Get password] button.
    5. Check the password.

    Set access environment (Classic)

    To set up a server access environment in the Classic environment of the NAVER Cloud Platform console, you need to set up port forwarding.

    Caution

    In this section, we will briefly introduce how to set up the access environment. For details about setting up access environment, please refer to the following guide.

    Set port forwarding (Classic)

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

    1. From the NAVER Cloud Platform console's Classic environment, click the Services > Compute > Server menus, in that order.
    2. Select the server to set port forwarding for, and then click the [Set port forwarding] menu.
    3. Enter the external port number you want to set, and then click the [Add] button.
      • The range of available external port is 1,024 - 65,534. These external ports can only be used for the purpose of server access.
    4. Click the [Apply] button.

    Get admin password (Classic)

    After setting up port forwarding, you can get the admin (root) password required for accessing the application server through the following steps:

    1. From the NAVER Cloud Platform console's Classic environment, click the Services > Compute > Server menus, in that order.
    2. Click the [Manage servers] button, and then click the Get admin password menu.
    3. Enter the authentication key generated while creating the server.
    4. Click the [Get password] button.
    5. Check the password.

    Test application server connection

    You can use the terminal program, PuTTY, to test if you can connect to the application server properly through the following 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.
      clouddbformongodb-start-putty_vpc_en
    3. Click the [Open] button.
    4. When the PuTTY Security Alert pop-up window appears, click the [Accept] button.
      clouddbformongodb-start-connect_vpc_en(1).png
    5. When the cmd window for server connection appears, enter the password you got from Get admin password.
      clouddbforredis-start_03_vpc_en
    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 do the subscription request procedure from the console before the start of actual usage. However, for Cloud DB for MySQL, you can start using it upon creation of MySQL Server without a separate subscription request step. The following describes how to create a MySQL Server from the NAVER Cloud Platform console.

    Note
    • In this section, we will briefly introduce how to create a DB server. For details about full creation methods, please refer to Create MySQL Server.
    • Since an additional subscription request step does not exist for Cloud DB for MySQL, an additional subscription cancellation step does not exist, either. If you want to stop using Cloud DB for MySQL and prevent charges from incurring, then delete the MySQL Server you created and were operating. For more details about how to delete MySQL Servers, refer to Delete MySQL Server.
    1. From the NAVER Cloud Platform console, click the Services > Database > Cloud DB for MySQL menus, in that order.
    2. Click the DB Server menu.
    3. Click the [Create DB Server] button.
    4. When the subscription request page appears, enter the required information, and then click the [Next] button.
    5. Click the [Create] button.

    Set ACG

    The following describes how to set up the ACG (Access Control Group) of MySQL Servers from the NAVER Cloud Platform console.

    Note

    In this section, we will briefly introduce how to set up ACG. Please refer to the ACG Guide for more information about setting up ACG.

    1. From the NAVER Cloud Platform console, click the Services > Database > Cloud DB for MySQL menus, in that order.
    2. Click the ACG menu.
      clouddbformysql-start_acg_vpc_en(1).png
    3. Click and select the ACG to set up, and then click the [Set ACG] button.
      • 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 the [Add] button.
    7. Click the [Apply] button.

    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, and run the command shown below to install MySQL.
      • CentOS 6.x or 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
      
      Note

      Since CentOS 7.x, the default DB of MySQL installed with yum is changed to MariaDB, so the above commands need to be run for the installation.

    2. Run the following command to access the DB server.
      • The domain, port number, user ID, and password required for the DB access can be checked from the DB Server menu of the NAVER Cloud Platform console.
      [root@localhost ~] # mysql -h ① Private domain name -u ② user_id -p --port ③ DB access port
      
      -- Successful access example
      
      [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>
      

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.