Sources

MySQL

Check which MySQL versions SQL Flow can capture from, and what binlog capture needs on your server.

SQL Flow captures changes from MySQL and MariaDB by reading the row-based binary log (binlog) over the replication protocol, the same way a MySQL replica does. There is one capture mode, so the decisions on this page are about whether your server can run it.

Supported versions

VersionSupported
MySQL 8.0 and later, including 8.4 LTS and 9.xYes
MySQL 5.7 and earlierNo. SQL Flow needs binlog_row_metadata = FULL, which MySQL 8.0 introduced.
MariaDBYes. Choose MySQL in the wizard.

Managed services

Managed MySQL services such as Amazon RDS and Aurora MySQL, Azure Database for MySQL and Google Cloud SQL can be sources when they meet the same requirements as any other server:

  • The binlog settings below, set through the service's server parameters, with binary logging on and a binlog retention long enough for your pipelines.
  • REPLICATION SLAVE and REPLICATION CLIENT granted to the capture user itself.
  • With Encryption at Require (default), a server certificate the agent can validate. If the service's certificates come from its own certificate authority, the agent host needs that authority's certificate. See Binlog: Encrypted data.

Capture modes

ModeWhat it readsWhat you install on the database host
BinlogRow events from the binary log, streamed to the agent over a replication connectionNothing

The wizard shows no Capture mode choice for MySQL. When you pick MySQL on the Source step, the form asks for Host, Port (default 3306), Database, Username, a password or a secret reference, and Encryption.

Choosing a capture mode

MySQL has a single capture mode. Answer these questions to check that your server can run it.

  1. Is the server MySQL 8.0 or later?
    • No: upgrade the server.
    • Yes: go to question 2.
  2. Can binary logging run with binlog_format = ROW, binlog_row_image = FULL and binlog_row_metadata = FULL? These are server-wide settings. With anything else, the binlog doesn't carry complete rows and column names, and SQL Flow refuses to start rather than capture wrong values.
    • No: MySQL can't be a SQL Flow source.
    • Yes: go to question 3.
  3. Does the server accept TLS connections with a certificate the agent can validate, issued for the host name you connect to? With Encryption at Require (default), the agent encrypts its MySQL connections and validates the certificate.
    • No: install such a certificate on the server, or trust its certificate authority on the agent. Encryption at Prefer skips the check, for a server you trust on a network you trust. See Binlog: Encrypted data.
    • Yes: go to question 4.
  4. Can the capture login have REPLICATION SLAVE and REPLICATION CLIENT?
    • Yes: use Binlog.
    • No: MySQL can't be a SQL Flow source.
Binlog
Server settingslog_bin on, binlog_format = ROW, binlog_row_image = FULL, binlog_row_metadata = FULL
LoginREPLICATION SLAVE, REPLICATION CLIENT, SELECT on the captured tables
Installed on the database hostNothing
Holds on the sourceNothing. The server's binlog retention decides how long a stopped pipeline can resume.
Resume positionBinlog file name and offset, not GTID
Before-images of updates and deletesThe whole row
TRUNCATECaptured

See Choosing a capture mode for the comparison across every source engine.

Encrypted data

Binlog
Encrypted connectionRequired by default, with the server certificate and host name validated. Encryption at Prefer relaxes this.
Binary log encryption (binlog_encryption)The server decrypts events before it sends them over the replication connection. SQL Flow needs no setting for it.
InnoDB data-at-rest encryptionNot visible to SQL Flow: the server decrypts rows before it returns them.
Column values encrypted by the applicationCaptured and copied as stored, as ciphertext

See Binlog: Encrypted data for the TLS requirements, and Encrypted data support for every engine.

See also

Next
Binlog

If this was useful,
our newsletter will be too.

Get monthly insights on data engineering, AI, and building critical infrastructure - direct from the Spectral Core team and CEO Damir Bulic.