Error: Failed to Import Table Without a Primary Key
Issue
When attempting to sync a table without a primary key using the binary log update method, the sync fails with the following error:
We encountered a table without a primary key in your database that we failed to import after several attempts. To proceed with syncing, please de-select this table in the Schema tab or add a primary key.
Environment
- Connector: MySQL
Resolution
To resolve this issue, do one of the following:
Option 1: Add a primary key to the table
Adding a primary key allows Fivetran to import the data in smaller, incremental chunks and sync changes reliably.
Option 2: Exclude the table from the sync
- In Fivetran, go to your MySQL connection page.
- Select the Schema tab.
- Deselect the affected table.
- Click Save changes.
Cause
This issue occurs when a table without a primary key is too large to import in a single operation. Without a primary key, Fivetran can't divide the data into smaller chunks for processing, which can cause large table scans to time out or exhaust.
Smaller tables without primary keys may import successfully.