Access DB Server from outside cloud

Prev Next

Available in Classic

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 a public domain of MySQL Server.

Access through SSL VPN

You can access through MySQL Workbench after signing up and configuring the NAVER Cloud SSL VPN. SSL VPN provides a private network in which access in protected through SSL encryption. It restricts access to the private network to only allowed users by setting up routing and ACG, which makes server access and use more secure.

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

Caution

Additional fees apply when you subscribe to SSL VPN. For more information on SSL VPN and its pricing plans, see Services > Security > SSL VPN on the NAVER Cloud Platform portal.

  1. Access the SSL VPN after completing the subscription and settings by referring to the SSL VPN user guide.
  2. In the Classic environment of the NAVER Cloud Platform console, navigate to i_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 to Set ACG.
    • Access source: IP Pool of SSL VPN.
    • Allowed port (service): Access port of MySQL Server to connect to.
  5. Click Manage DB > Manage DB user, in order, and add an user to connect through SSL VPN.
  6. Download MySQL Workbench and follow the guide to install it.
  7. Run MySQL Workbench, and create a new MySQL Connection as follows:
    • Connection Method: Standard (TCP/IP)
    • Parameters tab
      • Hostname: Private domain of the MySQL Server to connect to.
      • Port: Access port of the MySQL Server to connect to.
      • Username: Account name of the MySQL Server to connect to.
  8. Click the created MySQL Connection to access the MySQL Server.

Access through 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

Public domains can only be applied for on the DB server created in the public subnet.

Caution

Through the public domain, the data communicated from the outside is charged based on network usage.

  1. In the Classic environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Database > Cloud DB for MySQL.
  2. Click the DB Server menu.
  3. Select the MySQL Server to set the public domain, click Manage DB > Manage public domain, in order, and click [Yes] on the settings popup window.
  4. Set ACG of the selected MySQL Server by referring to Set ACG.
  5. Click Manage DB > Manage DB User, in order, and add an user to connect through the public domain.
  6. Download MySQL Workbench and follow the guide to install it.
  7. Run MySQL Workbench, and create a new MySQL Connection as follows:
    • Connection Method: Standard (TCP/IP)
    • Parameters tab
      • Hostname: Public domain of the MySQL Server to connect to.
      • Port: Access port of the MySQL Server to connect to.
      • Username: 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.

Note

To access MySQL Server through phpMyAdmin in the Classic environment, you must first assign a public IP to the application server.

  1. Access the application server using the root account.
  2. Run the following command to install the Apache, PHP, and MySQL libraries 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 access, allow the 80 port in the ACG. For more information on how to set ACG, 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 commands 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 commands 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
    
    -- Examples
    $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 public IP/phpMyAdmin' in a web browser, and log in to the user account of the MySQL Server you have connected to.