Accessing DB server from outside cloud
    • PDF

    Accessing DB server from outside cloud

    • PDF

    Article Summary

    Available in Classic and VPC

    You can use the MySQL client, MySQL Workbench or phpMyAdmin, to access the MySQL Server from outside of NAVER Cloud Platform, and perform various tasks related to DB conveniently in the client.

    Access using MySQL Workbench

    You can use Workbench, a MySQL client, to access the MySQL Server from outside of NAVER Cloud Platform and perform tasks. To access the MySQL Server using MySQL Workbench, you need to first set NAVER Cloud SSL VPN or the public domain of the MySQL Server.

    Access using SSL VPN

    You can request subscription to the NAVER Cloud's SSL VPN, and set it to access the MySQL Server using MySQL Workbench. The SSL VPN is a service that provides a private network where the access is protected through SSL encryption. It sets routing and ACG to limit access only for the allowed users, which enables more secure server access and usage.

    The following describes how to access a MySQL Server using MySQL Workbench after setting SSL VPN.

    Caution

    Additional charges apply when you request subscription to SSL VPN. For the introduction on SSL VPN and details about its pricing plans, refer to the Service > Security > SSL VPN menu in the NAVER Cloud Platform portal.

    1. Complete service subscription request and settings by referring to the SSL VPN guide, and then access the SSL VPN.
    2. From the NAVER Cloud Platform console, click the Services > Database > Cloud DB for MySQL menus, in that order.
    3. Click the DB Server menu.
    4. Select the MySQL Server you want to access, and set the ACG by referring to Set ACG.
      • Access source: SSL VPN's IP pool
      • Allowed port (service): Access port of the MySQL Server to access
    5. Click the Manage DB > Manage DB user menus, in that order, and add the user that will access using SSL VPN.
    6. Download the MySQL Workbench, and then install it according to the guide.
    7. Run MySQL Workbench, and then create a new MySQL connection as shown below.
      • Connection Method: Standard (TCP/IP)
      • Parameters tab
        • Hostname: Private domain of the MySQL Server to access
        • Port: Access port of the MySQL Server to access
        • Username: Account name of the user for the MySQL Server to access
    8. Click the created MySQL connection to access the MySQL Server.

    Access using public domain

    You can set a public domain to the MySQL Server, and access the server using MySQL Workbench.

    The following describes how to access a MySQL Server using MySQL Workbench after setting a public domain.

    Caution

    The data communicated from the outside through the public domain is charged based on network usage.

    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. Select the MySQL Server you want to set a public domain for, click the Manage DB > Manage public domain menus in order, and then click the [Yes] button from the settings pop-up window.
    4. Set the ACG of the selected MySQL Server by referring to Set ACG.
    5. Click the Manage DB > Manage DB user menus, in that order, and add the user that will access using the public domain.
    6. Download the MySQL Workbench, and then install it according to the guide.
    7. Run MySQL Workbench, and then create a new MySQL connection as shown below.
      • Connection Method: Standard (TCP/IP)
      • Parameters tab
        • Hostname: Public domain of the MySQL Server to access
        • Port: Access port of the MySQL Server to access
        • Username: Account name of the user for the MySQL Server to access
    8. Click the created MySQL connection to access the MySQL Server.

    Access using phpMyAdmin

    You can use phpMyAdmin, a MySQL client based on php, to access MySQL Servers on web browsers, and perform various tasks including editing DBs, running SQL status, and managing users and permissions.

    The following describes how to access a MySQL Server using phpMyAdmin from a web browser after installing phpMyAdmin on the application server. The description is based on CentOS 7.0 version application servers.

    Note

    To access the MySQL Server using phpMyAdmin from the Classic environment, assign a public IP to the application server first.

    1. Access the application server with the root account.
    2. Run the following command to install Apache, PHP, and MySQL libraries to the application server.
      # yum -y install httpd php mysql php-mysql
      
      • Once the installation is complete, check if the MySQL Server can be accessed normally.
    3. Run the following command to install the EPEL package for the automatic update of yum.
      # yum -y install epel-release
      
    4. Enter the following command to start the service.
      # systemctl restart httpd
      
      • After starting the service, access "http://(server's public IP address)" from a web browser to see if the Apache server is running normally.
    5. Access the application server the root account, and run the following command to install the phpMyAdmin package.
      # yum install phpMyAdmin
      
    6. Run the following command to reload (reload) the Apache.
      # systemctl reload httpd
      
    7. Run the following commands, in order, to set the IP to allow access to phpMyAdmin.conf.
      # cd /etc/httpd/conf.d
      
      # cp -a phpMyAdmin.conf phpMyAdmin.conf.origin
      
      # vi phpMyAdmin.conf
      <Directory /usr/share/phpMyAdmin/>
         AddDefaultCharset UTF-8
      
         <IfModule mod_authz_core.c>
           # Apache 2.4
           <RequireAny>
             Require ip 127.0.0.1 # Edit it to the IP to allow access
             Require ip ::1
           </RequireAny>
         </IfModule>
         <IfModule !mod_authz_core.c>
           # Apache 2.2
           Order Deny,Allow
           Deny from All
           Allow from 127.0.0.1 # Edit it to the IP to allow access
           Allow from ::1
         </IfModule>
      </Directory>
      
      <Directory /usr/share/phpMyAdmin/setup/>
         <IfModule mod_authz_core.c>
           # Apache 2.4
           <RequireAny>
             Require ip 127.0.0.1 # Edit it to the IP to allow access
             Require ip ::1
           </RequireAny>
         </IfModule>
         <IfModule !mod_authz_core.c>
           # Apache 2.2
           Order Deny,Allow
           Deny from All
           Allow from 127.0.0.1 # Edit it to the IP to allow access
           Allow from ::1
         </IfModule>
      </Directory>
      
    8. Run the following commands, in order, to reload (reload) the Apache.
      # cd ~
      
      # systemctl reload httpd
      
      • After the reload, access "http://server's public IP/phpMyAdmin" from a web browser to see if the phpMyAdmin page is displayed normally. If you can't access it normally, then check the ACG and phpMyAdmin.conf settings of the server.
    9. Run the following commands, in order, to enter the access settings for phpMyAdmin.
      # cd /etc/phpMyAdmin
      # vi config.inc.php
      $cfg['Servers'][$i]['host']          = 'Private domain of the MySQL Server to access'; // MySQL hostname or IP address
      $cfg['Servers'][$i]['port']          = 'Access port of the MySQL Server to access';          // MySQL port - leave blank for default port
      
      -- Example
      $cfg['Servers'][$i]['host']          = 'db-d3oh.beta-cdb.ntruss.com'; // MySQL hostname or IP address
      $cfg['Servers'][$i]['port']          = '3306';          // MySQL port - leave blank for default port
      
    10. Access "http://server's public IP/phpMyAdmin" from a web browser, and log in with the user account for the configured MySQL Server.

    Was this article helpful?

    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.