Skip to main content

Accessing MySQL Local Data Sources via Gateway

NineData supports connecting to MySQL data sources through a gateway, allowing you to integrate MySQL instances that are on a private or proprietary network into NineData without providing a public internet address.

Prerequisites

  • The host where the gateway is to be deployed must be the same as the MySQL data source host or within the same internal network as the MySQL data source host, with the latter requiring smooth internal network access to the MySQL data source.
  • The host where the gateway is to be deployed must have access to the public internet. If your host does not have public internet access and is within a local area network, you can deploy it through a proxy gateway. For more information, please refer to Using a Proxy Gateway.

Step One: Deploy the Gateway

This step is applicable to hosts that have access to the public internet. If your host cannot access the public internet and is within a local area network, please refer to Using a Proxy Gateway for gateway deployment.

  1. Log in to the NineData Console on the host where you need to deploy the gateway.

  2. In the left navigation bar, click >.

  3. Click on on the page.

  4. Configure the parameters according to the table below.

    ParameterDescription
    The name of the gateway, for easy later search and management, supports manual specification.
    Select the operating system of the host where the gateway needs to be deployed, and display the corresponding gateway installation method. Supports the following operating systems:
    • Windows(x86_64)
    • Linux(x86_64)
    • macOS
    Choose the region closest to the location of the host where the gateway is deployed to get a relatively fast access speed.
    No configuration required.
  5. According to the installation method shown below, install and configure the gateway on the deployment host. After the configuration is completed, the connection diagram on the right side of the page will change from to .

  6. Click , in the pop-up window, select the data source you need to add, and proceed to Step Two.

Step Two: Connect to the MySQL Data Source

  1. On the page, configure the parameters according to the table below.

    Parameter
    Description
    Enter the name of the data source. For easy subsequent searching and management, please use a meaningful name.
    Select .
    Select the gateway ID deployed in Step One.
    The access address and port of the MySQL data source.
    • If MySQL is installed on this machine: fill in localhost or 127.0.0.1 on the left, and the actual access port of MySQL on the right.
    • If MySQL is installed on another host within the internal network: fill in the internal IP of that host on the left, and the actual access port of MySQL on the right.
    Enter the login username for MySQL.
    Enter the login password for MySQL.
    Select the region closest to the location of your MySQL host to effectively reduce network latency.
    Choose based on the actual business purpose of the data source, serving as an environmental identifier for the data source. Default environments provided are and , and you are also supported to create a custom environment.
    Note: Under the organizational model, database environments can also be applied to permission policy management. For example, the default role only supports access to data sources under the environment and cannot access data sources in other environments. More information can be found in Managing Roles.
    Whether to use SSL encryption to access the data source (default on). If the data source enforces SSL encrypted connections, this switch must be turned on, otherwise the connection will fail.
    Click the switch on the right to turn on or off encrypted transmission. Click the > on the left side of to expand detailed configuration.
    • : Supports the following two methods.
      • : Automatically detect the server's SSL status, if the server has SSL enabled, it will prioritize SSL connection, if the server does not have SSL enabled, it will use a non-SSL method to connect.
      • : Always use SSL to connect to the data source, if the server does not support this method or fails to establish an SSL connection for other reasons, the connection will fail.
    • : Specify the SSL-Cipher encryption algorithm.
    • : If the MySQL server uses a certificate issued by a self-signed CA, you need to upload the root certificate of that CA here.
    • : Check the box to verify the server's name and IP address, etc., to ensure that you are connecting to the real MySQL server and avoid man-in-the-middle attacks.
    • : If the MySQL server requires the client to provide a certificate, you need to upload the client's certificate and key here, and the MySQL server will verify the information you uploaded to ensure the security of the connection.
    Note: Under normal circumstances, if the MySQL server supports SSL encrypted connections, you only need to select , and there is no need to configure other options, the system will automatically generate keys for you to connect.
  2. After all configurations are completed, click the on the right side of to test whether the data source can be accessed normally. If prompted with , you can click to complete the addition of the data source. Otherwise, please recheck the connection settings until the connection test is successful.

Appendix: Using a Proxy Gateway

If the host you need to deploy the gateway cannot access the public internet, you will need to use a proxy gateway. You need to prepare two hosts that are on the same local area network and can access each other:

  • Host A: The host that can access the public internet.
  • Host B: The host that cannot access the public internet but needs to deploy the gateway.

Create a gateway on Host A, which acts as a proxy, allowing Host B to connect to the NineData server through this proxy.

Operation Steps

  1. Log in to the NineData Console on Host A.

  2. In the left navigation bar, click >.

  3. Click on the page.

  4. Configure the parameters according to the table below.

    ParameterDescription
    The name of the gateway, for easy later search and management, supports manual specification.
    Select the operating system of the host where the gateway needs to be deployed, and display the corresponding gateway installation method. Supports the following operating systems:
    • Windows(x86_64)
    • Linux(x86_64)
    • macOS
    Select the region closest to the location of the host where the gateway is deployed to get a relatively fast access speed.
    No configuration required.
  5. According to the installation method shown below, install and configure the gateway on Host A. After the configuration is completed, the connection diagram on the right side of the page will change from to .

  6. Click , and then click in the upper right corner of the page again.

  7. In , select the operating system of Host B.

  8. Click , select , and click the dropdown box under . In the dropdown menu, select the gateway created on Host A.

    tip

    At this point, the gateway process will automatically open a port on Host A for Host B's access. When the page prompts xxx has enabled proxy functionality, port xxx, it means that the proxy gateway has been successfully opened.

  9. Follow the installation steps indicated below to install the gateway on Host B.

  10. Wait for the connection diagram on the right side of the page to change from to .

  11. Click to proceed to Step Two.