Metabase is an open source business intelligence (BI) platform that supports a variety of data sources, such as MySQL and PostgreSQL. You can use Metabase to explore and visualize data of different database engines on an intuitive web page. This topic describes how to use Metabase to connect to AnalyticDB for MySQL.
Prerequisites
Java Development Kit (JDK) 21 or later is installed.
Metabase is installed. For more information, see Metabase documentation.
The IP address of the server that runs Metabase is added to an IP address whitelist of an AnalyticDB for MySQL cluster. For more information, see IP address whitelists.
Procedure
Execute the following statement on an AnalyticDB for MySQL cluster to allow other data types to be converted into the UNSIGNED INTEGER type. This ensures that Metabase can correctly obtain metadata.
SET ADB_CONFIG O_UNSIGNED_AS_BIGINT_ENABLED=true;
Access the web page of Metabase. In the upper-right corner of the page, click the
icon and select Admin settings.
In the top navigation bar, click Databases. On the Databases page, click Add database.
Configure the parameters that are described in the following table and click Save.
Parameter
Description
Database type
The type of the database engine. Select MySQL from the drop-down list.
Display name
The name of the data source.
Host
The endpoint of the AnalyticDB for MySQL cluster.
If Metabase is installed on an Elastic Compute Service (ECS) instance that resides in the same virtual private cloud (VPC) as the AnalyticDB for MySQL cluster, enter an internal endpoint.
If Metabase is installed on an on-premises server, enter a public endpoint.
Port
The port number. Set the parameter to 3306.
Database name
The name of the database in the AnalyticDB for MySQL cluster.
Username
The name of the database account of the AnalyticDB for MySQL cluster.
Password
The password of the database account of the AnalyticDB for MySQL cluster.
Additional JDBC connection string options
Enter tinyInt1isBit=false.
NoteDo not add spaces before or after the equal sign (
=
). Otherwise, data visualization fails after you connect to the AnalyticDB for MySQL cluster.Other parameters
For information about the other parameters, see Metabase documentation.
After the preceding configurations are complete, you are connected to the AnalyticDB for MySQL cluster. Execute SQL statements and perform data analysis on the query results. For more information about data analysis operations, see Metabase documentation.