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 topic describes how to connect Metabase to AnalyticDB for MySQL.
Prerequisites
Java Development Kit (JDK) 21 or later is installed.
Metabase is installed. For more information, see the Metabase official documentation.
The IP address of the Metabase server is added to an IP address whitelist of an AnalyticDB for MySQL cluster. For more information, see IP address whitelists.
To connect to a Spark Java Database Connectivity (JDBC) endpoint, you must also create a Spark Interactive resource group.
Connect Metabase to an ADB MySQL endpoint
In an AnalyticDB for MySQL cluster, execute the following command to allow other data types to be converted to the UNSIGNED INTEGER type. Otherwise, Metabase cannot correctly obtain the metadata.
SET ADB_CONFIG O_UNSIGNED_AS_BIGINT_ENABLED=true;Access 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 and then click Add Database.

Configure the following parameters and click Save.
Parameter
Description
Database type
Select MySQL from the drop-down list.
Display name
The name for the data source. You can specify a custom name.
Host
The endpoint of the AnalyticDB for MySQL cluster.
If Metabase is installed on an ECS instance, and the ECS instance is in the same VPC as the AnalyticDB for MySQL cluster, enter an internal endpoint.
If Metabase is installed on a local server, enter the public endpoint.
Port
The value is fixed at 3306.
Database name
The database in the AnalyticDB for MySQL cluster.
Username
The database account for the AnalyticDB for MySQL cluster.
Password
The password for the database account of the AnalyticDB for MySQL cluster.
Additional JDBC connection string options
Enter tinyInt1isBit=false.
NoteDo not add spaces before or after
=. Otherwise, data visualization fails after you connect to the AnalyticDB for MySQL cluster.More parameters
For more information about other parameters, see the Metabase official documentation.
After the configuration is complete, you can connect to AnalyticDB for MySQL to perform data analytics. For more information about data analytics operations, see the Metabase official documentation.

Connect Metabase to a Spark JDBC endpoint
Access 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 and 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
The name for the data source. You can specify a custom name.
Host
The endpoint of the Spark Interactive resource group. For information about how to obtain the endpoint, see Preparations.
Port
The port number of the Spark Interactive resource group. The value is fixed at 10000.
Database name
The database in the AnalyticDB for MySQL cluster.
Username
The database account for the AnalyticDB for MySQL cluster.
Password
The password for the database account of the AnalyticDB for MySQL cluster.
Additional JDBC connection string options
Enter
?resource_group=<Resource Group Name>.After the configuration is complete, you can connect to AnalyticDB for MySQL to perform data analytics. For more information about data analytics operations, see the Metabase official documentation.
