Metabase is an open source business intelligence (BI) platform that supports multiple data sources, such as MySQL and PostgreSQL. It provides an intuitive web interface that allows users of different databases to easily explore and visualize their data. This topic shows you how to connect Metabase to AnalyticDB for MySQL.
Prerequisites
-
Java Development Kit (JDK) 21 or later is installed.
-
Metabase is installed. For detailed instructions, see the official Metabase documentation.
-
Add the IP address of the server where Metabase is running to the whitelist of your AnalyticDB for MySQL cluster. For more information, see Configure a whitelist.
-
To connect to a Spark JDBC endpoint, you must create a Spark Interactive resource group.
Connect to the AnalyticDB for 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. This ensures that Metabase can correctly retrieve metadata.
SET ADB_CONFIG O_UNSIGNED_AS_BIGINT_ENABLED=true; -
Go to the Metabase web interface. In the upper-right corner, click the gear icon (
) and select Admin settings from the drop-down menu.
-
In the top navigation bar, click Databases. On the Databases page, click Adding a Database.

-
Configure the following parameters and click Save.
Parameter
Description
Database type
Select MySQL from the drop-down list.
Display name
Enter a custom name for the data source.
Host
The endpoint of your AnalyticDB for MySQL cluster.
-
If Metabase is installed on an ECS instance, and the ECS instance and the AnalyticDB for MySQL cluster are in the same VPC, enter the internal endpoint.
-
If Metabase is installed on a local server, enter the public endpoint.
Port
The port number, fixed at 3306.
Database name
Enter the name of the database in your AnalyticDB for MySQL cluster.
Username
Enter the database account for your AnalyticDB for MySQL cluster.
Password
Enter the password for the database account of your AnalyticDB for MySQL cluster.
Additional JDBC connection string options
Enter tinyInt1isBit=false.
NoteDo not add spaces before or after the equal sign (
=). Otherwise, you will be unable to visualize data after connecting to the AnalyticDB for MySQL cluster.Other parameters
For information about other parameters, see the official Metabase documentation.
-
-
After you complete the configuration, you can connect to AnalyticDB for MySQL and start data analysis. For more information about data analysis, see the official Metabase documentation.

Connect to the Spark JDBC endpoint
-
Go to the Metabase web interface. In the upper-right corner, click the gear icon (
) and select Admin settings from the drop-down menu.
-
In the top navigation bar, click Databases. On the Databases page, click Adding a Database.

-
Configure the following parameters and click Save.

Parameter
Description
Database type
Select Spark SQL from the drop-down list.
Display name
Enter a custom name for the data source.
Host
Enter the endpoint of the Spark Interactive resource group. For more information, see View the endpoint and port of a resource group.
Port
The port number of the Spark Interactive resource group, fixed at 10000.
Database name
Enter the name of the database in your AnalyticDB for MySQL cluster.
Username
Enter the database account for your AnalyticDB for MySQL cluster.
Password
Enter the password for the database account of your AnalyticDB for MySQL cluster.
Additional JDBC connection string options
Enter
?resource_group=<your_resource_group_name>. -
After you complete the configuration, you can connect to AnalyticDB for MySQL and start data analysis. For more information about data analysis, see the official Metabase documentation.
