A MySQL export runs a SQL query you write on the flow's schedule and pulls the matching rows from your MySQL database into a flow. This article is for builders creating a scheduled export; it covers the connection you need, the export form, and the export types. To stream inserts, updates, and deletes as they happen instead of polling, use a MySQL listener. See Listen for real-time changes from MySQL.
Prerequisites
- A MySQL connection. See Set up a connection to MySQL.
Choose a scheduled export or a real-time listener
When you create a MySQL export, Flow step type offers two options.
- Export records from source application – Runs a SQL query on the flow's schedule and returns the matching rows. The rest of this article describes this option.
- Listen for real-time data from source application – Streams inserts, updates, and deletes from the binary log as they occur, using change data capture (CDC). See Listen for real-time changes from MySQL.
Export data from the connected database
- Go to Resources > Exports to open the list of exports for your account.
- Select + New export.
- In the Create export panel, enter a meaningful name. Name is required; Description is optional.
- In Application, select MySQL.
- In Connection, select a connection. The list shows only connections for the database type you selected. To add a new connection, select the plus (+).
-
In Query, write the SQL statement that returns the data you need.
Note: Some servers require the database name when you reference a table – for example,
SELECT * FROM salesrecords.order;wheresalesrecordsis the database name. - Select an Export type:
- All – Export all data every time the flow runs.
- Delta – Export only data that changed since the last flow run.
- Once – Export only data that hasn't been exported before.
- Limit - export a set number of records – Export a set number of records. Used mainly for testing, to avoid syncing large volumes. When you select this type, the How many records would you like to export? setting becomes available. Enter the maximum number of records to export each time the flow runs. Default: 1. Maximum: 100.
-
Select Preview to see sample data in JSON format. If the query doesn't run successfully, revise Query or Export type.
Note: In the export Preview and in import mapping Input, bigint values appear as strings. Returning them as strings avoids precision loss for very large numbers.
- Select Save, then add the export to a flow.
Group export records
The Grouping option groups exported records by one or more fields, so downstream steps receive related records together – for example, all order lines for the same order ID in one record.