Docs/Streams/Database Guides/MySQL

MySQL Target Configuration

Use this page when MySQL is the target for a DBConvert Streams workflow.

MySQL targets receive data from both Load and CDC streams. The source can be MySQL, PostgreSQL, local files, or S3-compatible storage.

Target privileges

The target user needs write access to the target database. The exact privileges depend on the stream configuration:

PrivilegeWhen needed
INSERTAlways — all streams write rows
CREATEWhen structure options allow table/index creation
ALTERWhen structure options create indexes or constraints on existing tables
DROPWhen schemaPolicy is drop_and_recreate
TRUNCATEWhen writeMode is truncate_and_load

Example grant for a target user that can create and write:

GRANT INSERT, CREATE, ALTER, DROP ON target_db.* TO 'target_user'@'%';
FLUSH PRIVILEGES;

For connection and network setup, see MySQL Server Configuration. To verify visible tables and schemas, open the connection in Data Explorer.

Target behavior

Two settings control what the stream does with existing target tables and data:

SettingWhat it controlsDefault (Load)Default (CDC)
schemaPolicyWhat to do if target tables already existfail_if_existsvalidate_existing
writeModeWhat to do if target tables contain rowsfail_if_not_emptyupsert

CDC mode supports upsert (default, recommended) and append. Use append for insert-only workloads where you want maximum write throughput. See Target Schema and Data Policies for all values and decision guidance.

Structure creation

By default, the stream creates missing tables, indexes, foreign keys, and check constraints on the target. Disable any of these with structure options.

When the source is PostgreSQL, data types are converted automatically. See Table Structure Conversion for the full mapping.

Performance tuning

For high-volume streams (millions of rows), MySQL server settings have a significant impact on write throughput. The defaults prioritize durability over speed — every transaction commit triggers an fsync to disk. Relaxing these settings can improve write performance by 2–5x.

SET GLOBAL innodb_flush_log_at_trx_commit = 2;
SET GLOBAL sync_binlog = 0;
SET GLOBAL innodb_io_capacity = 2000;
SET GLOBAL innodb_io_capacity_max = 4000;
SettingDefaultRecommendedEffect
innodb_flush_log_at_trx_commit1 (fsync every commit)2 (fsync once per second)Largest single improvement. Reduces disk I/O per transaction.
sync_binlog1 (fsync every binlog event)0 (OS-managed flush)Reduces binlog write overhead.
innodb_io_capacity2002000Allows InnoDB to flush dirty pages faster.
innodb_io_capacity_max20004000Upper bound for background flushing.

Trade-off: With innodb_flush_log_at_trx_commit = 2, up to one second of committed transactions can be lost if the MySQL process crashes (not the OS — only the mysqld process). For CDC workflows this is safe because the source replication slot retains unacknowledged data, so the stream can be restarted without data loss.

To make these settings persistent across MySQL restarts, add them to your MySQL configuration file (my.cnf or my.ini):

[mysqld]
innodb_flush_log_at_trx_commit = 2
sync_binlog = 0
innodb_io_capacity = 2000
innodb_io_capacity_max = 4000

Buffer pool sizing

For large transfers, increase the InnoDB buffer pool to at least 50% of available RAM:

SET GLOBAL innodb_buffer_pool_size = 1073741824;  -- 1 GB

Cloud-hosted MySQL

Managed MySQL services (AWS RDS, Google Cloud SQL, Azure Database for MySQL) may not expose all InnoDB settings. Check your provider's documentation for available parameters. Most providers default to innodb_flush_log_at_trx_commit = 1, which can be changed through parameter groups (RDS) or database flags (Cloud SQL).

Benchmark: 10 million rows, PostgreSQL CDC → MySQL

A real-world CDC stream migrating 10,000,000 rows (1.14 GB) from PostgreSQL to MySQL with 2× target writers and the tuning settings above:

10M row PostgreSQL CDC to MySQL benchmark — 1.14 GB transferred in 2.36 minutes

MetricValue
Rows transferred10,000,000
Data size1.14 GB
Source read rate8.47 MB/s
Target write rate (avg)10.30 MB/s
Elapsed time2.36 min
Target writers

The stream used the recommended innodb_flush_log_at_trx_commit = 2 and sync_binlog = 0 settings on the MySQL target. With default MySQL settings, the same transfer takes significantly longer due to per-transaction disk flushes.

Validation checklist

  1. Test the target connection from the Data Explorer sidebar (right-click → Test connection) or from the connection editor.
  2. Open the target database in Data Explorer and confirm the expected database is reachable.
  3. Verify the target user has the required privileges for your chosen schema policy and write mode.
  4. Run a small validation stream (one or two tables) before scaling up.