Skip to main content

MySQL

Step 1: Create a dedicated read-only MySQL user​

To sync data from your MySQL database securely, we recommend creating a dedicated read-only user. This keeps permissions minimal and gives you better control over data access. Alternatively, you can use an existing MySQL user with the necessary permissions.

Run the following command to create a new user:

CREATE USER <user_name> IDENTIFIED BY 'your_password_here';

Next, grant this user read-only access to the relevant schemas and tables:

GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO <user_name>;
note

If you choose the STANDARD replication method (not recommended), the SELECT permission is sufficient.

Step 2: Enable binary logging on your MySQL server​

To use change data capture (CDC) for real-time syncing, enable binary logging (binlog) on your MySQL server. Most cloud providers, such as AWS and Google Cloud, offer a one-click option for this.

If you manage your MySQL server yourself, set the following properties in the MySQL configuration file.
server-id = 223344
log_bin = mysql-bin
binlog_format = ROW
binlog_row_image = FULL
binlog_expire_logs_seconds = 864000
  • server-id: must be unique for each server and replication client in the MySQL cluster, and non-zero. If it's already set to a non-zero value, no change is needed. Any value between 1 and 4294967295 works. See the MySQL documentation.
  • log_bin: the base name of the binlog files. If it's already set, no change is needed. See the MySQL documentation.
  • binlog_format: must be ROW. See the MySQL documentation.
  • binlog_row_image: must be FULL. It determines how row images are written to the binary log. See the MySQL documentation.
  • binlog_expire_logs_seconds: the number of seconds before binlog files are removed automatically. We recommend 864000 seconds (10 days), so that if a sync fails or is paused, it can still resume from where it stopped. We also recommend syncing frequently when using CDC.

Step 3: Add the integration to RevOS​

With your MySQL server configured, set up the integration in RevOS.

note

If you restrict access to your database, allow connections from the RevOS IP addresses.

  1. Basic configuration: enter the hostname, port number, and database name of your MySQL instance.
  2. Authentication: enter the username and password you created in Step 1.
Important

You can't build a table directly from an integration. Once the integration has synced, first create a semantic model based on its data — then you can build tables.

Configure the update method​

MySQL update method settings: Read Changes using Binary Log (CDC), initial waiting time, server timezone, invalid CDC position behavior and initial load timeout

  1. Update Method: how changes are picked up. We recommend Read Changes using Binary Log (CDC) for efficient, real-time syncing.
  2. Initial Waiting Time in Seconds: how long to wait for new data when a sync starts. The default is 300 seconds; any value between 120 and 1200 seconds works.
  3. Configured server timezone: your MySQL server's timezone. Only needed if it doesn't follow the standard IANA time zone names.
  4. Invalid CDC position behavior: what happens if the saved position in the binary log is no longer valid. Fail sync stops the sync until it is reset manually; Re-sync data reloads the data automatically, which takes longer and may miss some changes.
  5. Initial Load Timeout in Hours: the maximum time the initial data load may run before switching to CDC.

Step 4: Connect via SSH tunnel (optional)​

If direct access to your MySQL server is restricted, you can connect through an SSH tunnel. RevOS then connects securely through an intermediate (bastion) server that has access to the MySQL database.

  1. SSH Tunnel Method: choose how to authenticate the tunnel:
    • SSH Key Authentication: uses a private key.
    • Password Authentication: uses a password.

MySQL optional fields: password, JDBC URL parameters, SSL mode and SSH tunnel settings

SSH tunnel fields​

  1. SSH Tunnel Jump Server Host: the hostname or IP address of the bastion server RevOS connects through.
  2. SSH Connection Port: the SSH port of the bastion server (default 22).
  3. SSH Login Username: the user for the bastion server (an operating system user, not the MySQL user).
  4. Authentication:
    • With SSH Key Authentication, provide the private key.
    • With Password Authentication, enter the operating system user's password (not the MySQL password).

Generating a private key for SSH tunneling​

SSH Key Authentication needs an RSA private key in PEM format. You can generate one with:

ssh-keygen -t rsa -m PEM -f myuser_rsa

This creates a private key in PEM format and a matching public key. Add the public key to the bastion host for the user RevOS should log in as, then paste the private key into the integration's SSH Private Key field.