Metabase is an open-source business intelligence (BI) platform that lets you explore and visualize data from various data sources, such as MySQL and PostgreSQL, through an intuitive web interface. This guide explains how to connect Metabase to AnalyticDB for MySQL using either a standard MySQL endpoint or a Spark Java Database Connectivity (JDBC) endpoint.
Prerequisites
Before you begin, make sure you have:
Java Development Kit (JDK) 21 or later installed
Metabase installed. For details, see the Metabase documentation
The IP address of your Metabase server added to the IP address whitelist of your AnalyticDB for MySQL cluster. For details, see IP address whitelists
(Spark JDBC only) A Spark Interactive resource group created. For details, see Create a Spark Interactive resource group
Connect Metabase to an ADB MySQL endpoint
In your AnalyticDB for MySQL cluster, run the following command to allow other data types to be converted to the UNSIGNED INTEGER type.
WarningIf you skip this step, Metabase cannot correctly obtain the metadata.
SET ADB_CONFIG O_UNSIGNED_AS_BIGINT_ENABLED=true;Open the Metabase web interface. In the upper-right corner, click the
icon and select Admin Settings from the drop-down menu.
In the top navigation bar, click Databases, then click Add Database.

Configure the following parameters and click Save. For other parameters, see the Metabase documentation.
WarningIn the Additional JDBC connection string options field, do not add spaces before or after
=. A space in this value causes data visualization to fail after the connection is established.Parameter Description Database type Select MySQL from the drop-down list. Display name A display name for the data source. Any name works. Host The endpoint of your AnalyticDB for MySQL cluster. Use the internal endpoint if Metabase runs on an Elastic Compute Service (ECS) instance in the same Virtual Private Cloud (VPC) as the cluster. Use the public endpoint if Metabase runs on a local server. Port Fixed at 3306. Database name The name of the database in your AnalyticDB for MySQL cluster. Username The database account for your AnalyticDB for MySQL cluster. Password The password for the database account. Additional JDBC connection string options Enter tinyInt1isBit=false. After saving, you can connect to AnalyticDB for MySQL and start data analytics. For available operations, see the Metabase documentation.

Connect Metabase to a Spark JDBC endpoint
Open the Metabase web interface. In the upper-right corner, click the
icon and select Admin Settings from the drop-down menu.
In the top navigation bar, click Databases, then click Add Database.

Configure the following parameters and click Save.
Parameter Description Database type Select Spark SQL from the drop-down list. Display name A display name for the data source. Any name works. Host The endpoint of the Spark Interactive resource group. To get this endpoint, see Preparations. Port Fixed at 10000. Database name The name of the database in your AnalyticDB for MySQL cluster. Username The database account for your AnalyticDB for MySQL cluster. Password The password for the database account. Additional JDBC connection string options Enter ?resource_group=<Resource Group Name>, replacing<Resource Group Name>with the name of your Spark Interactive resource group.
After saving, you can connect to AnalyticDB for MySQL and start data analytics. For available operations, see the Metabase documentation.
