1. Overview

After configuring the MySQL data source, you can import its data into the Sensors Data table or entity using the Data Fusion > Task Management feature, making it easier to use in subsequent modules such as reports, analysis models, and intelligent operations.

Before configuring the data source, please refer to the following content to confirm whether your MySQL data source meets the requirements:

Data Source TypeData Source NameVersion RequirementsUser Permission RequirementsOther Requirements
Database ClassMySQL

5.x version, 8.x version

SELECT Permission

None

2. Add MySQL Data Source

  1. Select Data Fusion > Generic Data Access > Data Source Management.
  2. Click All Data Sources Tab.
  3. Click MySQL Data Source.
  4. Click the Create button in the upper right corner.
  5. Fill inMySQL connection information.
    1. Data Source Connection Name: User-defined by you, is the unique identification of the data source connection in the platform.
    2. Server : IP address to which the data source is connected.
    3. Port : indicates the port number to which the data source is connected.
    4. Database name : Optional. You can specify a specific database. If you do not specify a specific database, all databases under the connection will be obtained.
    5. UsernameValid user name for the data source connection.
    6. Password: indicates the valid password of the user name.
    7. SSL authentication: If SSL authentication is enabled for your MySQL, you can choose to enable it in the Configure Connection window. After this function is enabled, you need to upload the following key files that support SSL authentication:
      1. CA certificate: Only support .pme and .cer format file; For example: ca.pem.
      2. Client certificate: Only support .pme and .cer format file; For example: client-cert.pem.
      3. Client private key: Only support .pme and .cer format file; For example: client-key.pem.
    8. Connection parameter:Optional, hold the connection parameters of your own data source, please use when multiple parameters & to divide, such as: key1=true&key2=false.
    9. Data connection URL : Automatically generated based on the preceding information.
  6. Click Test Connection button.
  7. Click Submit button.

3. Manage MySQL data Sources

  1. Select Data Fusion > Universal Data Access > Data Source Management.
  2. Click Added data source Tab page.
  3. ClickMySQL data source.
    1. Edit: support modify all configuration parameters of the data connection.
    2. Delete: Delete the current connection.

If the current data connection is used by a task, modifying parameters or deleting the connection will cause the task to fail.

4. Field Type Mapping Rules

Importing data from MySQL data source to the Sensor Data table, field type mapping errors may cause content conversion errors or task execution failures. Configure field mapping according to the following rules, data conversion is safe:

Original Field TypeData Table Field Type
tinyintNUMBER / INT / BIGINT
smallintNUMBER / INT / BIGINT
mediumintNUMBER / INT / BIGINT
intNUMBER  / INT / BIGINT
bigintNUMBER / BIGINT
decimalNUMBER
doubleNUMBER
floatNUMBER
enumSTRING
charSTRING
tinytextSTRING
textSTRING
mediumtextSTRING
longtextSTRING
varcharSTRING
yearSTRING
dateTIMESTAMP
datetimeTIMESTAMP
timestampTIMESTAMP

Instructions

  1. The above mentioned types are currently supported MySQL field types;
  2. If a task is imported with an unsupported type field, the task fails to be executed.