Skip to main content

Overview

In addition to MySQL, OLake Go also supports MariaDB flavor as CDC source. It supports multiple sync modes and offers features like parallel chunking, checkpointing, and automatic resume for failed full loads. This connector can be used within the OLake UI or run locally via Docker for open-source workflows.

Integration guides

Tested, step-by-step guides take MySQL to Apache Iceberg, Snowflake, Databricks, BigQuery, Redshift, ClickHouse and DuckDB, each from a pipeline that was run end to end.

Sync Modes Supported​

  • Full Refresh
  • Full Refresh + CDC
  • CDC Only
  • Full Refresh + Incremental

Prerequisites​

Version Prerequisites​

MySQL Version: MySQL 5.7+

CDC Prerequisite​

Connection Prerequisites​

  • Read access to the tables for the MySQL user.

After initial Prerequisites are fulfilled, the configurations for MySQL can be configured.


Configuration​

1. Navigate to the Source Configuration Page​

  1. Complete the OLake UI Setup Guide
  2. After logging in to the OLake UI, select the Sources tab from the left sidebar.
  3. Click Create Source on the top right corner.
  4. Select MySQL from the connector dropdown
  5. Provide a name for this source.

2. Provide Configuration Details​

  • Enter MySQL credentials.

Change data capture (CDC)​

FieldDescriptionExample Value
Enable CDCEnables change data capture to sync like inserts, updates, and deletes. When enabled, CDC-specific fields appear below. When disabled, supports only Full Refresh and Incremental sync modes.Enabled (default)
Initial Wait TimeMaximum duration in seconds to wait before considering the binlog syncer idle. Recommended: 10800 (3 hours), and the minimum is 120.10800

Connection details​

FieldDescriptionExample Value
MySQL Host requiredList of database host addresses to connect to.mysql-host
DatabaseName of the target database to use.mysql-db
Username requiredUsername for authenticating with the database.mysql-user
Password requiredPassword for the database user.mysqlpwd
Port requiredPort number on which the database server is listening.3306
JDBC URL ParametersExtra JDBC URL parameters for fine-tuning the connection.{"connectTimeout":"10000"}
SSL ConfigurationDefines whether the connection to the database is encrypted over TLS/SSL. Needed to meet security requirements and connect to databases that do not allow plain-text traffic.
  • require
  • disable
  • verify-ca
  • verify-full
Certificate InputDefines how TLS/SSL certificates are provided. Paste the PEM content, or give the file path of each certificate. For Certificate File Path, mount the files first: Docker Compose or Kubernetes. The three certificate fields below must all use the same method.
  • Inline Certificate (PEM) (default)
  • Certificate File Path
Server CA Certificate
or
Server CA Certificate Path
CA certificate for server verification.
  • Inline: Paste the PEM content.
  • Path: File path to the certificate.
Inline: <PEM content>

Path: /etc/ssl/custom-certs/ca.pem
Client Certificate
or
Client Certificate Path
Client certificate for mutual TLS authentication. Set together with Client Key.
  • Inline: Paste the PEM content.
  • Path: File path to the certificate.
Inline: <PEM content>

Path: /etc/ssl/custom-certs/client.pem
Client Key
or
Client Key Path
Client private key for mutual TLS authentication.
  • Inline: Paste the PEM content.
  • Path: File path to the key.
Inline: <PEM content>

Path: /etc/ssl/custom-certs/client.key
Skip TLS VerificationIndicates whether to skip TLS certificate verification.false

Additional configuration​

FieldDescriptionExample Value
Max ThreadsMaximum number of parallel threads for processing or syncing data.3
Backoff Retry CountNumber of retry attempts for establishing sync with exponential backoff.3
SSH ConfigConfigure OLake Go to connect through an SSH tunnel.
  • No Tunnel
  • SSH Key Authentication
  • SSH Password Authentication

3. Test Connection​

  • Click Set up source to validate the configuration. The test performs three checks:

    Testing Source Configuration modal showing connection success, required MySQL CDC prerequisite checks, and optional CDC settings
    1. Connection validation: Verifies that OLake Go can reach the MySQL server using the provided host, port, credentials, and SSL settings.

    2. Required CDC prerequisites validation (when CDC is enabled): Evaluates required server-side settings to ensure reliable CDC operation:

      • binlog_access: User must have binlog read privileges
      • log_bin: Binary logging must be enabled
      • binlog_format: Must be set to ROW
      • binlog_row_image: Must be set to FULL
    3. Optional CDC prerequisites validation (when CDC is enabled): Evaluates optional server-side settings:

      • binlog_row_metadata: Binlog row metadata should be set to FULL
      • binlog_retention: Binlog retention must be sufficient for expected sync pauses
  • If any required check fails, the test connection will show the current and recommended values. Fix the server-side settings and retry the connection.

  • If any optional check fails, the test connection will show the current and recommended values. You can fix the server-side settings and retry, or continue and create the source without making changes.

  • If all checks pass, the MySQL source is created successfully. Jobs can then be configured using this source.

  • In case of connection failure, refer to the Troubleshooting section.


Data Type Mapping​

MySQL Data TypesDestination Data Type
int, int unsigned, mediumint, mediumint unsigned, smallint, smallint unsigned, tinyint, tinyint unsignedint
bigint, bigint unsignedbigint
floatfloat
decimal(p,s), numeric(p,s) with p up to 38, unsigned includeddecimal(p,s)
decimal(39-65,s)double
double, double precision, realdouble
datetime, timestamptimestamptz
char, varchar, text, tinytext, mediumtext, longtext, enum, json, bit(1), timestring
binary(n)fixed[n]
varbinary, blob, tinyblob, mediumblob, longblobbinary
Decimal columns
  • New jobs: jobs created on OLake Go v1.2.0 and above land these columns as decimal(p,s).
  • Existing jobs: jobs created on an older version keep these columns as double. To switch them to decimal(p,s), upgrade to OLake Go v1.2.0 and above and run Clear Destination. Upgrading OLake Go alone does not convert a column that already lands as double.
  • A destination decimal holds at most 38 digits, because Iceberg and Spark hold no wider decimal. A scale of 0 still maps to a decimal, so NUMERIC(10) becomes decimal(10,0).
  • Columns that land as double keep about 17 significant digits, so wider values round.
  • If a double column is part of the primary key, keys that differ only past about 17 significant digits get the same _olake_id and replace each other in upsert mode.
  • Decimal columns keep every digit when used as a cursor field, in a data filter or in the primary key's _olake_id.
INT UNSIGNED mapping change

From OLake Go version 0.4.1 and above, INT UNSIGNED maps to bigint in the destination. In versions earlier than 0.4.1, it maps to int.

timestamptz timezone

OLake Go always ingests timestamp data in UTC format, independent of the source timezone.


Date and Time Handling​

During transfer, values in date, time, and timestamp columns are modified to ensure valid calendar ranges and destination compatibility.

  • Case I (Year 0000):
    Source dates with year 0000 are not valid in most destinations, so we change them to the epoch start date.
    Example: 0000-05-10 → 1970-01-01
  • Case II (Year > 9999):
    Extremely large years are capped at 9999. The month and date are not affected.
    Examples: 10000-03-12 → 9999-03-12
  • Case III (Invalid month/day):
    When the month or day exceeds valid ranges (i.e. month > 12 or day > 31), or the combined date is invalid, the value is replaced with the epoch start date.
    Examples: 2024-13-15 → 1970-01-01, 2023-04-31 → 1970-01-01
Note

These rules apply to date, time, and timestamp columns during transfer.


Migrate an Existing Job to GTID​

Without GTID, OLake Go saves its CDC position as a binlog file name and offset, which only exist on the server that wrote them. After a blue/green switchover or when a replica is promoted to primary, the new primary has its own binlog files, so that saved position no longer applies. With GTID on, every transaction keeps the same ID on every server, so the job continues where it stopped, and the _cdc_timestamp column gets microsecond precision instead of seconds.

Once GTID is on, OLake Go switches the saved position to GTIDs by itself, and no change to the source configuration is needed. Turn GTID on in stages, with a sync in between, so every change written before GTID was on is read first.

Version requirement

OLake Go v1.1.2 and above.

Turn On GTID​

  1. On the server, set enforce_gtid_consistency=ON.
  2. Set gtid_mode=OFF_PERMISSIVE, then gtid_mode=ON_PERMISSIVE.
  3. In OLake UI, go to Jobs, open your MySQL job and click Sync Now. Wait for the run to succeed. This run picks up every change written before GTIDs were on.
  4. On the MySQL server, set gtid_mode=ON.
  5. Click Sync Now again, or wait for the next scheduled run. OLake Go switches its saved position to GTIDs automatically.

To confirm, open the job logs of the next run. They show Resuming MySQL CDC with GTIDs, and the job's state contains gtid_set.

note

If a run logs Deferring GTID migration, that is expected. Let the scheduled runs continue until GTIDs are in use.

Blue/Green Switchover​

Find the case that matches your setup, follow its steps, then switch over.

Case 1: Green Not Created Yet​

  1. Complete Turn On GTID on the current database (blue).
  2. Create the blue/green deployment. Choose a parameter group for green's engine version with GTID ON, never the default one.
  3. On green's endpoint, check that SELECT @@gtid_mode; returns gtid_mode as ON. Do not continue if it does not.

Case 2: Green Already Created, Blue Has GTID Off​

The switch to GTID has to happen on blue.

  1. Delete the blue/green deployment.
  2. Complete Turn On GTID on blue, so OLake Go switches to gtid_set.
  3. Create the deployment again with a GTID-ON parameter group, as in Case 1.

Case 3: Green Already Created, Green Has GTID On​

Nothing to fix on green.

  1. On green's endpoint, check that SELECT @@gtid_mode; returns gtid_mode as ON.
  2. Make sure OLake Go has already switched to GTIDs on for blue: the job logs show Resuming MySQL CDC with GTIDs, and the job's state contains gtid_set.

Case 4: Green Already Created, Green's GTID Is Not On​

For example, green has gtid_mode = OFF_PERMISSIVE from the default parameter group.

  1. Modify green: set its DB parameter group to a GTID-ON group for green's engine version, choose Apply immediately, then reboot green.
  2. On green's endpoint, check again that SELECT @@version, @@gtid_mode; returns gtid_mode as ON.
  3. Run the final sync in Switch Over only after green's reboot.
note

If you cannot attach a GTID-ON group to green, for example because no group exists for its engine version, delete the deployment and create it again with the right version and parameter group.

Switch Over​

  1. In OLake UI, run a final Sync Now. Optionally, Pause the job for the few minutes of the switchover.
  2. On the database, switch over.
  3. In OLake UI, resume the job if you paused it, then click Sync Now.
    • Do not change the source settings.
    • The run should succeed. In the job's state, server_uuid changes to green's, gtid_set contains both UUIDs, and the data has no gaps or duplicates.

After the Switchover​

  1. Check binlog retention on the new primary. On RDS, run CALL mysql.rds_show_configuration;.
  2. Delete the old blue database once a sync on green has succeeded.

If a Run Fails After the Switchover​

The error appears in the job's logs.

Error mentionsCauseFix
gtid_mode=ONGreen's parameter group is wrong.Use a parameter group with GTID ON for green.
server UUID changedGTID was not on before the switchover.Run Clear Destination and sync the job again.
purgedBinlog retention is too short.Run Clear Destination and sync the job again.
cannot resume through anonymous transactionsThe server's binlog has changes written without GTIDs after the job's saved position, for example from a server that ran with GTID off.Run Clear Destination and sync again.

Troubleshooting​

1. Failed to Get Current Binlog Position​

Cause: Binary logging not enabled, wrong format, or insufficient privileges.
Fix:

  • Ensure binary logging is enabled:
sql
SHOW VARIABLES LIKE 'log_bin'; // Should return `ON`
  • Ensure row-based logging:
sql
SHOW VARIABLES LIKE 'binlog_format'; // Should return `ROW`.
  • Grant required privileges:
sql
GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO 'your_user'@'%';

2. Idle Timeout Reached, Exiting Binlog Syncer​

  • Cause: During CDC sync, OLake Go saves the binlog position as state. When the next CDC sync starts, OLake Go searches for this saved position in MySQL's binlog to resume from where it left off. If this search operation takes longer than the configured initial_wait_time (for example, if initial_wait_time is set to 120 seconds but searching the binlog takes 150 seconds), the timeout is triggered and the binlog syncer exits.
  • Fix: Increase the initial_wait_time value in your source configuration to allow sufficient time for OLake Go to locate the saved binlog position.

3. Column Count Mismatch: Expected X, Got Y​

  • Cause: Table schema changed after CDC started or incomplete binlog metadata.
  • Fix:
    • Ensure full binlog metadata:
    sql
    SHOW VARIABLES LIKE 'binlog_row_metadata';
    Should return FULL. To set it:
    sql
    SET GLOBAL binlog_row_metadata = 'FULL';
    Update my.cnf or my.ini for persistence. On Amazon RDS and Aurora this statement is refused (ERROR 1227): set binlog_row_metadata in the DB parameter group (RDS) or the DB cluster parameter group (Aurora), where it is a dynamic parameter.
    • Restart the connector after schema changes.

4. Failed to Get or Split Chunks​

  • Cause: Table stats not populated or table contains 0 records.

  • Fix: Run the following query to populate table statistics:

    sql
    ANALYZE TABLE <namespace>.<table_name>;

5. Failed to Load MySQL Timezone Location​

  • Cause: If you see the log message failed to load mysql timezone location %s, falling back to UTC. Set jdbc_url_params.time_zone to override: %s, it indicates that the MySQL timezone could not be loaded properly. This often occurs when timezone abbreviations (like 'IST') are used, which can lead to inconsistencies since multiple regions share the same short name (e.g., India, Israel, Ireland).
  • Fix:
    • First, check the current timezone settings:

      sql
      SELECT @@session.time_zone, @@global.time_zone, @@system_time_zone;

      If any of these returns IST or another abbreviation, this can cause inconsistency issues.

    • Option 1 (Set via JDBC using IANA timezone name):

      • Use IANA timezone names (e.g., Asia/Kolkata) instead of abbreviations. Set this in the JDBC URL parameters:
        json
        {
        "jdbc_url_params": {
        "time_zone": "Asia/Kolkata"
        }
        }
      • Verify that IANA timezones are available in your database:
        sql
        SELECT count(*) FROM mysql.time_zone_name;
        If this returns 0, the timezone tables are not present. In this case you should use Option 2 instead.
    • Option 2 (Use timezone offset):

      • If IANA timezone names are not available in your environment, use a fixed offset instead:
        json
        {
        "jdbc_url_params": {
        "time_zone": "+05:30"
        }
        }

If the issue is not listed here, post the query on Slack to get it resolved within a few hours.

Changelog​

Date of ReleaseVersionDescription
27 August 20250.1.11override default timeout in Discover