MySQL

Source and destination

📘

Whitelist IPs

If your database's network-access policy requires you to allowlist Polytomic's IP addresses, see Whitelist IPs.

  1. Create a user on your MySQL database. You supply this account's credentials to Polytomic. See the next section for required permissions and queries to execute.

  2. In Polytomic, go to Connections → Add connection → MySQL.

  3. Enter host and credential details:

    • Hostname, Port (default 3306), Username, and Password.
    • Database (optional) — the database to connect to by default.
    • Use SSL and SSL mode — see SSL below.
  1. Click Save.

Polytomic supports users that authenticate with MySQL 8's default caching_sha2_password plugin. You don't need to enable mysql_native_password, which MySQL 8.4 disables by default.

Required MySQL user permissions

Create a MySQL user for Polytomic

These queries create a user for Polytomic and grant it read access to your database (replace my_database and my_password with your values):

CREATE USER 'polytomic_user'@'%' IDENTIFIED BY 'my_password';
GRANT SELECT ON my_database.* TO 'polytomic_user'@'%';

Repeat the GRANT SELECT statement for each database you want to sync from. Polytomic reads table and column metadata from information_schema. Every user can query information_schema for the objects they have privileges on, so you don't need an additional grant.

Write permissions

To let Polytomic also write to MySQL, grant these additional privileges on each database that Polytomic writes to:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP ON my_database.* TO 'polytomic_user'@'%';
  • Every Bulk Sync requires CREATE, ALTER, and DROP, not only full resyncs. Polytomic loads data into a staging table, then drops the previous table and renames the staging table into place.

  • If you want Polytomic to create new databases (for example, when a Bulk Sync writes to a database that doesn't exist yet), grant CREATE globally as well:

    GRANT CREATE ON *.* TO 'polytomic_user'@'%';

For change data capture (CDC) privileges, see CDC replication.

SSL

Use SSL is enabled by default. When it's enabled, choose an SSL mode:

SSL modeEncrypts connectionVerifies server certificateVerifies hostname
REQUIREDYesNoNo
VERIFY_CAYesYesNo
VERIFY_IDENTITY (default)YesYesYes

With VERIFY_CA and VERIFY_IDENTITY, Polytomic trusts certificates issued by public certificate authorities and by Amazon RDS (including Aurora), so RDS connections work without any extra configuration. If your server uses a certificate from a private or self-signed CA, paste the CA certificate (PEM format) into Additional CA certificate.

VERIFY_IDENTITY requires the Hostname you enter to match the name on the server's certificate. If you connect by IP address or through an alias that isn't on the certificate, use VERIFY_CA instead.

Connecting via SSH

Polytomic supports connecting to MySQL via SSH. See Connecting via an SSH tunnel for more information.

MariaDB

Polytomic doesn't separately test MariaDB with the MySQL connection. MariaDB GTIDs aren't compatible with MySQL GTIDs, so CDC replication from MariaDB uses binary log position tracking. Contact us if you have questions about MariaDB.