Connect Metabase to AnalyticDB for MySQL
Metabase is an open-source business intelligence (BI) platform that provides an intuitive web interface to explore and visualize data from various data sources, such as MySQL and PostgreSQL. This topic describes how to connect Metabase to AnalyticDB for MySQL.
Prerequisites
-
You have installed the Java Development Kit (JDK) 21 or a later version.
-
You have installed Metabase. For instructions, see the official Metabase documentation.
-
You have added the IP address of the server that runs Metabase to the IP address whitelist of your AnalyticDB for MySQL cluster. For more information, see IP address whitelist.
-
To connect to a Spark JDBC endpoint, you must create a Spark Interactive resource group.
Connect Metabase to an 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 the metadata.
SET ADB_CONFIG O_UNSIGNED_AS_BIGINT_ENABLED=true; -
Go to 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 Adding a Database.
-
Configure the following parameters, and then click Save.
Parameter
Description
database type
Select MySQL from the drop-down list.
display name
The name for the data source. You can enter a custom name.
host
The endpoint of your 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, use the internal endpoint.
-
If Metabase is installed on a local server, use the public endpoint.
port
The port is 3306.
database name
The name of the database in your AnalyticDB for MySQL cluster.
username
The username for the database account of your AnalyticDB for MySQL cluster.
password
The password for the database account of your AnalyticDB for MySQL cluster.
additional JDBC connection string options
Enter tinyInt1isBit=false.
NoteDo not add spaces around the
=symbol. Otherwise, data visualization will fail after you connect to the AnalyticDB for MySQL cluster.other parameters
For more 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 operations, see the official Metabase documentation.
For example, on the New question page of Metabase, select the ada_mysql data source, enter
select * from test3;in the SQL editor, and click Visualize. Metabase then displays the query results as a chart, such as a bar chart.
Connect Metabase to a Spark JDBC endpoint
-
Go to 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 Adding a Database.
-
Configure the following parameters, and then click Save.

Parameter
Description
database type
Select Spark SQL from the drop-down list.
display name
The name for the data source. You can enter a custom name.
host
The connection endpoint of the Spark Interactive resource group. To obtain the endpoint, see Prerequisites.
port
The port is 10000.
database name
The database in your AnalyticDB for MySQL cluster.
username
The username for the database account of your AnalyticDB for MySQL cluster.
password
The password for the database account of your AnalyticDB for MySQL cluster.
additional JDBC connection string options
Enter
?resource_group=<resource_group_name>. Replace<resource_group_name>with the name of your resource group. -
After you complete the configuration, you can connect to AnalyticDB for MySQL and start data analysis. For more information about data analysis operations, see the official Metabase documentation.
