All Products
Search
Document Center

Dataphin:Create a real-time dataset through MySQL

Last Updated:Jun 17, 2026

Dataphin allows you to process MySQL data source table fields using SQL to define dataset metrics. You can create and configure a real-time dataset using MySQL.

Prerequisites

  • Ensure you have created the tag project to which the dataset will belong. For more information, see Create a Tag Project.

  • Create a MySQL data source before setting up a real-time dataset. For detailed instructions, see Create a MySQL Data Source.

Procedure

  1. Navigate to the Dataphin home page and click Tag > Tag Workbench in the top menu bar.

  2. Open the Add Real-time Dataset dialog box.

    Select Tag Project > click Real-time Dataset > click Add Dataset.

    image

  3. In the Add Real-time Dataset dialog box, select MySQL Dataset.

  4. On the Add MySQL configuration page, configure the basic information for the dataset.

    Parameter

    Description

    Dataset Name

    The dataset name. It can include Chinese and English characters, numbers, and underscores (_), up to 64 characters.

    Dataset Code

    A unique identifier for the dataset. It must begin with a letter and can include lowercase letters, numbers, and underscores (_), up to 64 characters.

    Owner

    Select the dataset's owner.

    Description

    A brief description of the dataset, up to 1000 characters.

  5. Set up the Processing Logic for the dataset.

    Parameter

    Description

    Data Source

    The MySQL data source for the dataset.

    Processing Logic (SQL)

    Enter the SQL processing logic after selecting the data source.

    • The SELECT statement in SQL must include a field as the input parameter for the real-time tag query service.

    • SQL must contain a variable as the primary key, formatted as ${parameter}.

    • Example:

      SELECT pk, indicatorA, indicatorB FROM source_table where pk = ${parameter}

    Metric Configuration

    After entering the SQL logic, click Metric Parsing to configure the primary key/metric display name, value type, and description based on the parsed fields. Supported value types include string, long integer, double-precision floating-point number, date, Boolean, decimal.

    To configure additional metrics, click +add.

  6. Click Publish to create the dataset.

    Note

    After saving, click Authenticate to test your processing logic by entering the configured parameter values.

What to do next

After creating and publishing the real-time dataset, create real-time tags for it. For more information, see Real-Time Tag Overview.