You can add a MySQL data source to connect the MySQL database to Quick BI. After the connection is successful, data can be analyzed and displayed in the Quick BI console. Quick BI can be connected to a MySQL data source over the Internet or an internal network. This topic describes how to add a user-created MySQL data source.
Limits
Supports 5.5, 5.6, 5.7, and 8.0 versions.
Prerequisites
If you Quick BI connect to the MySQL database over the Internet, add the Quick BI IP address to the whitelist of the database. For more information, see Add security group rules.
If you want to connect Quick BI to the MySQL database over an internal network, make sure that one of the following methods is used to ensure the connectivity between Quick BI and the user-created MySQL data source:
If the MySQL database is deployed on an Elastic Compute Service (ECS) instance, you can connect Quick BI to the MySQL data source over a virtual private cloud (VPC).
You can deploy a jump server and access the database over an SSH tunnel.
A user-created MySQL database is created. The username and password that are used to access the user-created MySQL database are obtained.
The authentication AccessKey ID and AccessKey Secret are obtained. For more information, see Obtain an AccessKey.
Step 1: Enable the firewall
You can connect to a MySQL database over the Internet only after the firewall is enabled.
Run the following command to open the configuration file of the firewall:
vi /etc/sysconfig/iptables
Add the following command to the configuration file:
-A RH-Firewall-1-INPUT -m state -state NEW -m tcp -p tcp -dport 3306 -j ACCEPT
Run the following command to restart Iptable:
service iptables restart
Step 2: Add a user-created MySQL data source
After you log on to the Quick BI console.
Perform the steps that are shown in the following figure to add a user-created MySQL data source.
Go to the Create Data Source page.
Select MySQL Data Source.
Select User-created Data Source Type.
In the Add MySQL Data Sources dialog box, configure the parameters.
Feature
Description
Name
The display name of the data source configuration list.
The name cannot contain special characters or start or end with spaces.
Database address
The address where the MySQL database is deployed, including the IP address or URL.
Port Number
The corresponding port number of the database address.
Database
The name of the database that is customized when you deploy the database.
Username and Password
The username and password that are used to access the MySQL database.
VPC Data Source
Select VPC Data Source and configure the following parameters only if the MySQL database is deployed in a ECS and is deployed in a VPC:
AccessKey ID and AccessKey Secret: the AccessKey pair that is used to purchase the instance.
For more information, see Obtain an AccessKey pair.
Instance ID: the ID of the ECS instance.
Region: the region in which the ECS instance is deployed.
SSL
If SSL is configured for the data source that you want to access, you can also select SSL to protect data security.
SSH
If you select SSH, you must configure the following parameters:
You can deploy a jump server and connect to the database over an SSH tunnel. To obtain the jump server information, contact O&M personnel or system administrators.
SSH Host: the IP address of the jump server.
SSH Username and SSH Password: the username and password that are used to log on to the jump server.
SSH Port Number: the port number that is used to connect to the jump server. Default value: 22.
For more information, see Connect to a Linux instance by using a password.
Initialize SQL statements
The SQL statement that is initialized and executed after each data source connection. Only SET statements are allowed. The statements are separated by semicolons.
Enable the file upload portal
You can upload files after you enable this function.
Click Test Connection to verify that the data source can be connected.
Click OK.
What to do next
After you add a data source, you can create a dataset and analyze data.
For more information about how to add a table in a MySQL database or a user-created SQL statement to the Quick BI, see Create and manage datasets.
You can add charts for data analysis. For more information, see Create a dashboard and Overview of visualization charts.
Drill down the data for in-depth data analysis. For more information, see the Configure the drilling feature section of the "Drilling" topic.