All Products
Search
Document Center

AnalyticDB:Power BI

Last Updated:Sep 10, 2025

This topic describes how to use Power BI to connect to an AnalyticDB for MySQL cluster for real-time data analysis.

Prerequisites

Connect to an ADB MySQL endpoint using Power BI

Use a custom connector to connect (recommended)

You can use a custom connector or the built-in MySQL connector in Power BI to access AnalyticDB for MySQL data in import mode. You can also use a custom connector to access AnalyticDB for MySQL data in direct query mode. We recommend that you use a custom connector to connect to an AnalyticDB for MySQL cluster to support different data access modes.

Step 1: Install the MySQL ODBC driver

  1. Download and install the Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package MFC.

  2. Download and install version 5.1.13 of the MySQL ODBC Driver.

  3. Open ODBC Data Source Administrator (64-bit). On the Drivers tab, check whether the MySQL ODBC Driver is installed.

Step 2: Install the AnalyticDB for MySQL connector

  1. Download the AnalyticDB.MySQL.mez connector.

  2. Move the AnalyticDB.MySQL.mez connector to the Custom Connectors folder in the Power BI directory. The default path is `[Documents]\Power BI Desktop`. If the Custom Connectors folder does not exist, create it.

    Important
    • `[Documents]` refers to the Documents folder of the current user account. For example, the default path for the Administrator account is `C:\Users\Administrator\Documents\Power BI Desktop`.

    • Each user account has its own Documents folder. Power BI can load connectors only from the current user's folder. Therefore, you must install and maintain connectors for each account independently.

  3. Open Power BI and click Options and settings > Options.

    image

  4. Click Security. In the Data Extensions section, select (Not Recommended) Allow any extension to load without validation or warning and click OK.

    image

  5. In the Change Requires Restart dialog box, click OK. Then, restart Power BI.

Step 3: Use Power BI to connect to AnalyticDB for MySQL

  1. Open Power BI and click Get data from another source.

    image

  2. In the Get Data dialog box, select AnalyticDB MySQL(Beta)(Custom) and click Connect.

    image

  3. In the Connecting to a third-party service dialog box, click Continue.

    image

  4. In the AnalyticDB MySQL database dialog box, configure the parameters.

    image

    Parameter description:

    Parameter

    Required

    Description

    Server

    Yes

    The endpoint and port of the AnalyticDB for MySQL cluster. The format is <Endpoint>:Port.

    • Endpoint:

      • If Power BI is installed on ECS, and the ECS and the AnalyticDB for MySQL cluster are in the same VPC, enter the VPC address.

      • If Power BI is installed on a local server, enter the public endpoint.

    • The port is fixed at 3306.

    Database

    No

    The name of the database in the AnalyticDB for MySQL cluster.

    Connection timeout in seconds

    No

    The timeout period for connecting to the AnalyticDB for MySQL cluster. Unit: seconds (s).

    Read timeout in seconds

    No

    The maximum time allowed for a read operation. Unit: seconds (s).

    Write timeout in seconds

    No

    The maximum time allowed for a write operation. Unit: seconds (s).

    Don't cache results of forward-only cursors

    No

    Power BI does not cache query results when it uses forward-only cursors to query data.

    Force use of forward-only cursors

    No

    Power BI is forced to use forward-only cursors when it runs queries.

    Native query

    No

    The SQL query statement. If you leave this parameter empty, all tables in the AnalyticDB for MySQL cluster are listed in the Navigator dialog box in Step 6.

    Data Connectivity mode

    Yes

    The data connection mode. Valid values:

    • Import: import mode.

    • DirectQuery: direct query mode.

  5. In the AnalyticDB MySQL dialog box, configure the parameters and click Connect.

    image

    Parameter description:

    Parameter

    Description

    User name

    The database account of the AnalyticDB for MySQL cluster.

    Password

    The password of the database account for the AnalyticDB for MySQL cluster.

  6. In the Navigator dialog box, select the target data table, preview the data in the pane on the right, and then click Load.

  7. After the configuration is complete, you can start data analysis on the data source. For more information, see the official Power BI documentation.

    image

Use the built-in MySQL connector of Power BI to connect

  1. Download and install the MySQL Connector.

  2. Open Power BI and click Get data from another source.

    image

  3. Select MySQL database and click Connect.

    Note

    Power BI automatically detects whether the MySQL Connector is installed on your system. If it is not installed, follow the prompts to install it.

    image

  4. In the MySQL database dialog box, configure the parameters and click OK.

    image

    Parameter description:

    Parameter

    Required

    Description

    Server

    Yes

    The endpoint and port of the AnalyticDB for MySQL cluster. The format is <Endpoint>:Port.

    • If Power BI is installed on ECS, and the ECS and the AnalyticDB for MySQL cluster are in the same VPC, enter the VPC address.

    • If Power BI is installed on a local server, enter the public endpoint.

    Database

    No

    The name of the database in the AnalyticDB for MySQL cluster.

  5. In the MySQL Database dialog box, click the Database tab, configure the parameters, and then click Connect.

    image

    Parameter description:

    Parameter

    Required

    Description

    User name

    Yes

    The database account of the AnalyticDB for MySQL cluster.

    Password

    Yes

    The password of the database account for the AnalyticDB for MySQL cluster.

  6. In the Encryption Support dialog box, click OK.

    image

  7. In the Navigator dialog box, select the target data table, preview the data in the pane on the right, and then click Load.

  8. After you complete the configuration, you can start data analytics on this data source. For more information, see the official Power BI documentation.

    image

Connect to a Spark JDBC endpoint using Power BI

Precautions

After you connect to a Spark JDBC endpoint using Power BI, you can only read data from and write data to tables that use the XUANWU table engine. Tables that use the XUANWU_V2 table engine are not supported.

Procedure

  1. Download a driver.

    Power BI can connect to an interactive Spark resource group using the Microsoft Spark ODBC Driver or the Simba Spark ODBC Driver. Download the driver that meets your business needs.

  2. Create a data source.

    1. Open ODBC Data Source Administrator (64-bit). On the User DSN tab, click Add.

    2. In the Create New Data Source dialog box, select the driver that you downloaded in Step 1 and click Finish.

    3. In the Microsoft Spark ODBC Driver DSN Setup or Simba Spark ODBC Driver DSN Setup dialog box, configure the parameters.

      image

      Parameter

      Description

      Data Source Name

      The name of the data source. You can specify a custom name.

      Description

      The description of the data source. You can specify a custom description.

      Host(s)

      The endpoint of the interactive Spark resource group. For more information, see Preparations.

      Port

      The port of the interactive Spark resource group. The value is fixed at 10000.

      Database

      The name of the AnalyticDB for MySQL database.

      Mechanism

      The authentication method. In this topic, User Name and Password is selected.

      User Name

      The database account of AnalyticDB for MySQL and the name of the interactive Spark resource group. The format is Resource group name/Database account name.

      For example, if the resource group name is testjob and the database account name is test, enter testjob/test.

      Password

      The password of the AnalyticDB for MySQL database account.

      Thrift Transport

      The connection method. The value is fixed at SASL.

    4. Click SSL Options. In the SSL Options dialog box, clear Enable SSL and click OK.

      image

    5. Click Advanced Options. In the Advanced Options dialog box, select Get Tables with Query.

      image

    6. Click Server Side Properties. Clear Apply properties with queries and click OK.

      image

    7. In the Microsoft Spark ODBC Driver DSN Setup or Simba Spark ODBC Driver DSN Setup dialog box, click Test to test the connection.

      A SUCCESS message indicates that the ODBC connection to the AnalyticDB for MySQL interactive Spark resource group is successful.

      image

  3. Open Power BI and click Get data from another source.

    image

  4. In the Get Data dialog box, select ODBC and click Connect.

    image

  5. In the From ODBC dialog box, select the data source that you created in Step 2 and click OK. In this example, the data source is adb_test.

    image

  6. In the ODBC driver dialog box, click the Windows tab, select Use my current credentials, and then click Connect.

    image

  7. In the Navigator dialog box, select the target data table, preview the data in the pane on the right, and then click Load.

  8. After the configuration is complete, you can start data analytics on this data source. For more information, see the official Power BI documentation.

    image