Apache Superset is a free, open source data exploration and visualization platform that supports MySQL, PostgreSQL, and other Java Database Connectivity (JDBC)-compatible database engines. This guide walks you through connecting Superset to an AnalyticDB for MySQL cluster and running your first query in SQL Lab.
Prerequisites
Before you begin, ensure that you have:
Superset 4.1.1 or later installed. See Quickstart for installation instructions.
The IP address of the Superset server added to the IP address whitelist of your AnalyticDB for MySQL cluster. See IP address whitelists.
Connect Superset to AnalyticDB for MySQL
Step 1: Gather connection details
Collect the following information before configuring the connection in Superset:
| Parameter | Description |
|---|---|
| HOST | The endpoint of your AnalyticDB for MySQL cluster. Use the internal endpoint if Superset runs on an Elastic Compute Service (ECS) instance in the same virtual private cloud (VPC) as the cluster. Use the public endpoint if Superset runs on an on-premises server. |
| PORT | 3306 |
| DATABASE NAME | The name of the database in the cluster |
| USERNAME | The database account name |
| PASSWORD | The database account password |
| DISPLAY NAME | A display name for this connection in Superset |
Step 2: Install the MySQL driver (Python installs only)
Skip this step if you installed Superset with Docker — the MySQL driver is already included in the Docker image.
If you installed Superset with Python, install the MySQL driver manually. For driver options and installation commands, see Connecting to Databases.
Step 3: Add the database connection
Open the Superset web interface. In the upper-right corner, choose Settings > Database Connections.
On the Databases page, click +DATABASE in the upper-right corner.
In the Connect a database dialog box, select MySQL as the data source.
Enter the connection details you gathered in Step 1, then click CONNECT.
Step 4: Enable SQL Lab permissions
In the Actions column, click the
icon next to your new connection.Go to the ADVANCED tab and click SQL Lab.
Select the database operations to allow. For this example, select Allow DDL and DML, then click FINISH.

Step 5: Run a query in SQL Lab
In the top navigation bar, choose SQL > SQL Labs.
In the left-side pane, configure the following parameters:
Parameter Description DATABASE The connection you created in Step 3 SCHEMA The database where you want to run SQL SEE TABLE SCHEMA The table you want to query In the code editor on the right, enter and run your SQL statement.

After the query runs, results appear below the editor. Your AnalyticDB for MySQL cluster is now connected and ready to use with Superset.