Create a MariaDB Data Source
Add a MariaDB data source to NineData for Database DevOps, backup and restore, data replication, database comparison, and other supported features. This guide covers connection mode, deployment architecture, credentials, environment settings, SSL settings, and the connection test.
Before you begin
The server IP address of NineData has been added to the data source allowlist. The server IP address can be viewed by selecting the target region in Access Region on the Create Datasource page.

Make sure you have available data source quota; otherwise, the data source cannot be added. You can check your remaining quota in the NineData Console header.

Procedure
Sign in to the NineData Console.
On the left navigation pane, click Datasource > Datasource.
- Click Datasource tab, and click Create Datasource on the page. In the popup window for selecting the data source type, choose Database > (the type of data source to be added), and configure the parameters based on the table below on the Create Datasource page.tip
If you make a mistake during the operation, you can click the
icon at the top of the Create Datasource page to make a new selection.
Configure the data source parameters:
Parameter Description Name Enter a data source name. Use a meaningful name to find and manage it later. Connection Select how NineData connects to the data source. Supported methods are IP Address, Gateway, and SSH Tunnel. - IP Address: Connect through a public network address.
- Gateway: Use a NineData gateway for private-network access. Connect the host that runs the data source first. For instructions, see Add Gateway.
- SSH Tunnel: Connect through an SSH tunnel.
- IP Address: Connect through a public network address.
- SSH Tunnel: Connect through an SSH tunnel.
Configuration items when Connection is IP Address Host: The public network connection address and port of the data source. Configuration items when Connection is Gateway - Gateway: Select the NineData gateway installed on the host where the data source is located.
- Host: Enter localhost if the data source is on the same host as the gateway, or enter the internal IP address of the host where the data source is located.
Configuration items when Connection is SSH Tunnel - SSH Host: Enter the public IP address or domain name and SSH port of the server where the target data source is located. The default SSH port is 22.
- SSH Authentication Method: Select the SSH authentication method.
- Password: Connect with SSH Username and Password.
- SSH Username: Enter the login username of the server where the target data source is located.
- Password: Enter the login password of the server where the target data source is located.
- Key (recommended): Connect with SSH Username and Key File.
- SSH Username: Enter the login username of the server where the target data source is located.
- Key File: Click Upload to upload the private key file, which is a key file without a suffix. If you have not created one yet, see Generate SSH Tunnel Key File.
- Password: Enter the password set when the key file was generated. If no password was set during key generation, leave this field blank.
Note: After configuring SSH, click Connection Test to test the tunnel. Possible results: - Password: Connect with SSH Username and Password.
- Connection Successfully: The SSH tunnel is established.
- Error message: The connection failed. Troubleshoot the cause based on the error details and try again.
- Host: Enter localhost if the data source is on the same host as the SSH server, or enter the internal IP address of the host where the data source is located.
Architecture Type Select the deployment architecture of MariaDB. - Standalone: A standalone MariaDB database deployed on a single machine. Only one connection address and port are required.
- Disaster Recovery: A MariaDB database deployed with a disaster recovery architecture, usually including one master node and one or more disaster recovery nodes. Click Add below Host to enter multiple node addresses and ports.
- Read/Write Splitting: A MariaDB database deployed with a read-write separation architecture, usually including one write node (master node) and multiple read nodes (slave nodes). Click Add below Host to enter multiple node addresses and ports.
DB Account The username of the data source. DB Password The password of the data source. Access Region Select the region closest to the data source to help reduce network latency. Environment Choose an environment based on the business purpose of the data source. This environment identifies the data source. The default environments are PROD and DEV. Custom environments are supported. For details, see create a custom environment.
Note: Under organization mode, the database environment can also be applied to permission policy management. For example, the default Prod Admin role can access only data sources in the PROD environment and cannot access data sources in other environments. For more information, see Manage Roles.Encryption Choose whether NineData uses SSL encryption to access the data source (default: on). If the data source requires SSL-encrypted connections, enable this option; otherwise, the connection fails.
Use the switch to enable or disable encrypted transmission. Click the > to the left of Encryption to expand detailed configuration.- SSL Options: Supports the following methods.
- If Available: NineData detects the server SSL status. If SSL is enabled, NineData connects through SSL first. If SSL is not enabled, NineData uses a non-SSL connection.
- Require: Always use SSL to connect to the data source. If the server does not support SSL or the SSL connection cannot be established for another reason, the connection fails.
- SSL Cipher: Specify the SSL-Cipher encryption algorithm.
- Verify Server Certificate (SSL CA): If the MariaDB server uses a certificate issued by a self-signed CA, upload the root certificate of the CA here.
- Verify Server Identity (SSL Identify): Verify the server name, IP address, and related identity information to make sure that the connection reaches the intended MariaDB server and to help prevent man-in-the-middle attacks.
- Authenticate Client: If the MariaDB server requires a client certificate, upload the client certificate and key here. The MariaDB server verifies the uploaded information before accepting the connection.
After you configure all parameters, click Connection Test next to Create Datasource to test connectivity. When Connection Successfully is displayed, click Create Datasource to create the data source. Otherwise, review the connection settings and run the test again.
Result
After the connection test succeeds and the data source is created, it appears in the data source list and is available to NineData features that support MariaDB.
Appendix: Add NineData IP addresses to the MariaDB database whitelist (self-managed databases)
When you add a data source located in On-Premise/Other Cloud, add the NineData service IP address to the database whitelist so NineData can access the database.
The following example uses MariaDB 5.7.
Create a new account: Sign in to the database as the root user, create an account for NineData access, and grant the required permissions.
CREATE USER '<account name>'@'<NineData IP address>' IDENTIFIED BY '<access password>';
GRANT <permission name> ON <database name>.* TO '<account name>'@'<NineData IP address>';
FLUSH PRIVILEGES;Existing account: Sign in to the database as the root user, add the NineData IP address to the existing account, and grant the required permissions.
GRANT <permission name> ON <database name>.* TO '<account name>'@'<NineData IP address>' IDENTIFIED BY '<access password>';
FLUSH PRIVILEGES;
When you add the MariaDB data source in NineData, use the account and password configured with the NineData IP address.