Redash is an open source business intelligence (BI) tool that supports a variety of data sources, such as MySQL and PostgreSQL. You can use Redash to explore and visualize data of different database engines on an intuitive web page. This topic describes how to use Redash to connect to AnalyticDB for MySQL.
Prerequisites
Redash is installed. For more information, see Redash documentation.
The IP address of the server that runs Redash is added to an IP address whitelist of an AnalyticDB for MySQL cluster. For more information, see IP address whitelists.
Procedure
Run Redash. In the address bar of your browser, enter
http://<IP address>:<Port number>
to access the web page of Redash.IP address
: the IP address of the server that runs Redash.Port number
: The default port number is 5000. If port 5000 is already in use, you can change the port number when you run Redash.In the left-side navigation pane, click Settings. On the Data Sources tab, click +New Data Source.
In the Create a New Data Source dialog box, configure the parameters that are described in the following table and click Create.
Parameter
Description
Type Selection
The type of the data source. Select MySQL from the drop-down list.
Configuration
Name
The name of the data source. Enter a custom name.
Host
The endpoint of the AnalyticDB for MySQL cluster.
If Redash 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 Redash is installed on an on-premises server, enter a public endpoint.
Port
The port number. Set the parameter to 3306.
User
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.
Database Name
The name of the database in the AnalyticDB for MySQL cluster.
In the left-side navigation pane, choose
. In the right-side code editor, enter an SQL statement and click Execute.After the SQL statement is executed, click + Add Visualization and create a visual chart for the query results. For more information, see Redash documentation.