Superset is a free, open source modern data exploration and visualization platform. Superset supports various database engines, such as MySQL, PostgreSQL, and other database engines compatible with Java Database Connectivity (JDBC). You can use Superset to easily explore and visualize data of different database engines. This topic describes how to use Superset to connect to AnalyticDB for MySQL.
Prerequisites
Superset 4.1.1 or later is installed. For more information, see Quickstart.
The IP address of the server that runs Superset is added to an IP address whitelist of an AnalyticDB for MySQL cluster. For more information, see IP address whitelists.
Procedure
(Optional) Install a MySQL driver. For more information, see Connecting to Databases.
ImportantIf you install Superset based on Python, you must manually install the MySQL driver. If you install Superset based on Docker, the MySQL driver is pre-installed in the Docker image. You do not need to install the MySQL driver again.
Access the web page of Superset. In the upper-right corner of the page, choose
.In the upper-right corner of the Databases page, click +DATABASE.
In the Connect a database dialog box, select the MySQL data source, configure the required parameters that are described in the following table, and then click CONNECT.
Parameter
Description
HOST
The endpoint that is used to connect to the AnalyticDB for MySQL cluster.
If Superset is installed on an Elastic Compute Service (ECS) instance that resides in the same virtual private cloud (VPC) as the AnalyticDB for MySQL cluster, enter an internal endpoint.ECS
If Superset is installed on an on-premises server, enter a public endpoint.
POST
The port number. Set the parameter to 3306.
DATABSE NAME
The name of the database in the AnalyticDB for MySQL cluster.
USERNAME
The name of the database account of the AnalyticDB for MySQL cluster.
PASSWORD
The password of the database account of the AnalyticDB for MySQL cluster.
DISPLAY NAME
The display name of the data source connection.
After the connection is complete, click the
icon in the Actions column.
On the ADVANCED tab, click SQL Lab, select the allowed database operations, and then click FINISH. In this example, select Allow DDL and DML.
In the top navigation bar, choose
.In the left-side pane of the SQL Labs page, configure the parameters that are described in the following table. In the right-side code editor, execute an SQL statement.
Parameter
Description
DATABASE
The data source connection created in Step 4.
SCHEMA
The name of the database in which you want to execute the SQL statement.
SEE TABLE SCHEMA
The name of the table in which you want to execute the SQL statement.