MySQL Integration

Connect TDK to MySQL databases for data masking, generation, and subsetting.

Overview

TDK supports:

  • MySQL 5.7+

  • MySQL 8.0+

  • MariaDB 10.3+

  • Amazon RDS for MySQL

  • Azure Database for MySQL

  • Google Cloud SQL for MySQL

Connection Configuration

data_sources:
  input:
    url: jdbc:mysql://localhost:3306/mydb
    username: tdk_user
    password: ${vault:secret/mysql#password}
    driver_class_name: com.mysql.cj.jdbc.Driver

Required Permissions

-- Read-only (recommended for source)
GRANT SELECT ON mydb.* TO 'tdk_user'@'%';

-- Read-write (for target database)
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER
ON mydb.* TO 'tdk_user'@'%';

MySQL-Specific Considerations

Character Sets

Ensure UTF-8 compatibility:

ALTER DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Storage Engines

TDK supports: * InnoDB (recommended) * MyISAM (read-only recommended)

Performance Tips

  • Use indexed columns in WHERE conditions

  • Enable query cache for repeated reads

  • Consider max_allowed_packet for large batches