Skip to main content

MySQL

Introduction

The MySQL connector lets you:

  • Source: extract data from a MySQL database.
  • Destination: load data into a MySQL database.

Requirements

  • Network access from your runtime to the MySQL host/port.
  • A MySQL user with appropriate permissions:
    • Source: SELECT on the tables/views you want to read.
    • Destination: permissions to create and modify tables in the target schema (commonly CREATE, ALTER, INSERT, UPDATE, DELETE, DROP as required by your load mode).

Authentication

Configure the connector with standard MySQL credentials:

  • Host
  • Port
  • Username
  • Password
  • Database (source) / Schema (destination, if applicable)

If your environment requires TLS/SSL, configure your MySQL server and client settings accordingly (exact TLS fields depend on your deployment and platform configuration).

Setup

  1. Ensure the MySQL server is reachable from the connector runtime.
  2. Create a dedicated MySQL user for the connector.
  3. Grant the minimum required permissions for your use case (source and/or destination).
  4. Configure the connector with the connection details and test connectivity.

Configuration

Common connection fields

FieldTypeRequiredDescription
hoststringMySQL hostname or IP address.
portintegerMySQL port (typically 3306).
usernamestringUsername to connect with.
passwordstringPassword for the user.

Field names can differ between source and destination configurations. Use the field names shown in your connector configuration UI/runtime.

Source-specific fields

FieldTypeRequiredDescription
databasestringDatabase name to connect to.

Destination-specific fields

FieldTypeRequiredDescription
schemastringTarget schema/database name to write into. If omitted, the connector writes to the server’s default schema for the user.
no_auto_schema_creationbooleanIf true, the connector will not attempt to create the target schema automatically. If false, the connector may create the schema when needed (when schema is set).
table_prefixstringPrefix applied to all destination table names. Useful for namespacing multiple connections in the same schema.

Additional platform-specific fields (for example, TLS options) may be available depending on how you run the connector.

Source

How extraction works

The MySQL source reads tables (and/or views, depending on configuration) and emits records according to the selected extract mode (for example, full refresh or incremental where supported by your pipeline configuration).

System fields

The source adds the following system field:

  • _singular_extract_timestamp: the time the record was extracted.

Streams

Streams correspond to selected tables (and/or views). Each stream’s schema is derived from the MySQL table schema and mapped into the connector’s schema types.

Destination

Supported load modes

The MySQL destination supports common SQL-based load strategies, including:

  • Append
  • Incremental upsert
  • Full refresh (replace)
  • Full refresh (soft delete)
  • Partition overwrite
  • Incremental replica (see below)

Incremental replica load

Incremental replica load applies change events to the destination table by:

  1. Selecting the latest event per primary key from the incoming batch (based on a CDC LSN field).
  2. Applying deletes as updates to existing rows.
  3. Applying inserts/updates via an upsert (INSERT ... ON DUPLICATE KEY UPDATE) for non-deleted rows.

Requirements

To use incremental replica load, your destination stream must meet all of the following requirements:

  • The destination table must have a primary key (the load will fail if no primary key is defined).
  • The incoming schema for the stream must include these CDC fields:
    • _extract_deleted (boolean)
    • _extract_cdc_lsn
    • _extract_commit_timestamp

If any of these fields are missing, the load will fail.

Behavior

  • For each primary key, only the row with the maximum _extract_cdc_lsn in the batch is applied.
  • If the latest event has _extract_deleted = TRUE, the destination row is updated to reflect the delete by setting:
    • _extract_deleted = TRUE
    • _extract_cdc_lsn and _extract_commit_timestamp to the latest values
  • If the latest event has _extract_deleted = FALSE, the destination row is inserted or updated with the latest values.

Data type mapping

When creating or altering destination tables, the connector maps schema field types to MySQL types as follows:

Schema typeFormatMySQL type
string(none)VARCHAR
stringdateDATE
stringdate-timeDATETIME
numberDOUBLE
integerBIGINT
booleanBOOLEAN
arrayJSON
objectJSON
jsonJSON

Troubleshooting

  • Permission errors: ensure the MySQL user has the required privileges for the selected load mode.
  • Replica load failures:
    • Verify the stream has a primary key.
    • Verify the schema includes _extract_deleted, _extract_cdc_lsn, and _extract_commit_timestamp.
  • Connectivity issues: confirm host/port reachability, firewall rules, and MySQL server bind settings.