Documentation Index

Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

Access DB Server from outside the cloud

Prev Next

Available in VPC

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

Access through MySQL Workbench

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

Connect using SSL VPN

You can access through MySQL Workbench after signing up and configuring the NAVER Cloud SSL VPN. SSL VPN provides a private network protected by SSL encryption. By configuring routing and ACG settings, you can restrict access to authorized users only, enabling more secure server access and usage.

The following describes how to connect MySQL Server through MySQL Workbench after setting up SSL VPN:

Caution

Additional charges apply when subscribing to SSL VPN. For information about SSL VPN and pricing plan, see Services > Security > SSL VPN on the NAVER Cloud Platform portal.

  1. Access the SSL VPN after completing the subscription and settings while considering the SSL VPN user guide.
  2. In the VPC environment of the NAVER Cloud Platform console, navigate to Menu > Services > Database > Cloud DB for MySQL.
  3. Click the DB Server menu.
  4. Select the MySQL server to access, and set ACG by referring Set ACG.
    • Access source: IP pool of the SSL VPN.
    • Allowed port (service): Access port of MySQL Server to connect to.
  5. Navigate to Manage DB > Manage DB User and add a user to connect through SSL VPN.
  6. Download the MySQL Workbench and follow the guide to install it.
  7. Run the MySQL workbench and create a new MySQL Connection as follows:
    • Connection Method: Standard (TCP/IP)
    • Parameters tab
      • Hostname: The private domain of the MySQL server to connect to.
      • Port: The connection port of the MySQL server to connect to.
      • Username: The user account name of the MySQL server to connect to.
  8. Click the created MySQL Connection to access the MySQL Server.

Connect using a public domain

You can access the server through MySQL Workbench after setting a Public domain on MySQL Server.

The following describes how to connect MySQL Server through MySQL Workbench after setting up a Public domain:

Note

A public domain can only be applied for usage on the DB server created in Public Subnet.

Caution

Data communicated externally through a public domain is billed as network usage.

  1. In the VPC environment of the NAVER Cloud Platform console, navigate to Menu > Services > Database > Cloud DB for MySQL.
  2. Click the DB Server menu.
  3. Select the MySQL Server to set up Public domain, navigate to Manage DB > Manage Public domain, and click [Yes] on the settings popup.
  4. Set ACG of the selected MySQL Server by referring to Set ACG.
  5. Navigate to Manage DB > Manage DB User and add a user to connect through Public domain.
  6. Download the MySQL Workbench and follow the guide to install it.
  7. Run the MySQL workbench and create a new MySQL Connection as follows:
    • Connection Method: Standard (TCP/IP)
    • Parameters tab
      • Hostname: The public domain of the MySQL server to connect to.
      • Port: The connection port of the MySQL server to connect to.
      • Username: The user account name of the MySQL server to connect to.
  8. Click the created MySQL Connection to access the MySQL Server.

Access through phpMyAdmin

You can access MySQL Server from a web browser with phpMyAdmin, a php-based MySQL client, and perform various tasks such as editing DB, executing SQL status, managing user and permissions, and so on.

The following describes how to install phpMyAdmin from the application server, and access MySQL Server through phpMyAdmin in a web browser. The description is based on CentOS 7.0 application servers.

  1. Access the application server using the root account.
  2. Run the following command to install the Apache, PHP, MySQL library on the application server.
    # yum -y install httpd php mysql php-mysql
    
    • After completing installation, check if the connection to the MySQL Server is successful.
  3. Run the following command to install the EPEL package for yum automatic updates.
    # yum -y install epel-release
    
  4. Run the following command to restart the server.
    # systemctl restart httpd
    
    • After starting the service, access "http://(server public IP address)" in a web browser, and check if the Apache server is working properly.
      • If you cannot connect, allow port 80 in ACG. For more information, see Set ACG.
  5. Access the application server with the root account, run the following commands to install the phpMyAdmin package.
    # yum install phpMyAdmin
    
  6. Run the following command to reload (reload) Apache.
    # systemctl reload httpd
    
  7. Run the following command in order to set 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 # Change 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 # Change 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 # Change 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 # Change the IP to allow access
         Allow from ::1
       </IfModule>
    </Directory>
    
  8. Run the following command in order to reload (reload) Apache.
    # cd ~
    
    # systemctl reload httpd
    
    • After reloading, access "http://server public IP/phpMyAdmin" in a web browser, and check if the phpMyAdmin interface is working properly. If the connection is not successful, check the server ACG settings and phpMyAdmin.conf settings.
  9. Run the following command in order to specify the phpMyAdmin access settings:
    # cd /etc/phpMyAdmin
    # vi config.inc.php
    $cfg['Servers'][$i]['host']          = 'Private domain of MySQL Server to connect to'; // MySQL hostname or IP address
    $cfg['Servers'][$i]['port']          = 'access port of MySQL Server to connect to';          // MySQL port - leave blank for default port
    
    -- Example
    $cfg['Servers'][$i]['host']          = 'db-d3oh.cdb.ntruss.com'; // MySQL hostname or IP address
    $cfg['Servers'][$i]['port']          = '3306';          // MySQL port - leave blank for default port
    
  10. Access "http://server public IP/phpMyAdmin" in a web browser, and log in to the user account of the MySQL Server you have connected to.