Azure Database for MySQL to BigQuery, in real time
Replicate Azure Database for MySQL Flexible Server into BigQuery in real time. The binary log is already on; set its retention, add a firewall rule, and stream every change within seconds.
- Setup time
- About 15 minutes
- Restart needed
- No restart needed.
- Binary log retention
- binlog_expire_logs_seconds = 259200
Set up Azure Database for MySQL for change data capture
The in-app guide shows each of these with exact clicks and copy-paste commands, then tests the connection. Full reference: MySQL setup for change data capture.
- 1
Binary logging is already on
Flexible Server writes the binary log in ROW format by default, so there is nothing to enable.
- 2
Keep binary logs for 3 days
In Server parameters, set binlog_expire_logs_seconds to 259200. The default of 0 lets Azure delete logs as soon as it can.
- 3
Confirm the row image
Check that binlog_row_image is FULL.
- 4
Add a firewall rule
Under Networking, add a firewall rule allowing our IP addresses. Flexible Server requires TLS by default, which we use automatically.
- 5
Connect BigQuery and pick tables
Upload a service-account key, choose the tables, and start. Existing rows are copied first; after that every insert, update and delete arrives within seconds. See BigQuery setup.
What you get in BigQuery
- An up-to-date copy of each table with the same primary key, optionally partitioned by date.
- A change history of every insert, update and delete in a separate dataset, kept as long as you choose.
- New columns added automatically, and per-table freshness you can monitor.
Related guides
- How to connect MySQL to BigQuery: 5 ways
- Check your MySQL binlog settings (free tool)
- MySQL binlog_format and binlog_row_image explained
- The best MySQL to BigQuery replication tools
- Syncing MySQL deletes to BigQuery
Azure Database for MySQL questions
Is Azure Database for MySQL Single Server supported?
Single Server has been retired by Microsoft; use Flexible Server.
Does the connection use TLS?
Yes. Flexible Server requires encrypted connections by default, and they are used automatically.
How do I connect Azure Database for MySQL to BigQuery?
Follow the steps above to turn on the binary log and allow access, create a read-only replication user, then upload a BigQuery service-account key and choose the tables. Existing rows are copied once and every later insert, update and delete is replicated. Most teams finish in about 15 minutes.
How quickly do Azure Database for MySQL changes reach BigQuery?
Each change reaches a change-history table in BigQuery within seconds. The up-to-date copy of each table refreshes on a schedule you choose, from every minute to every hour (every 5 minutes by default).
Can I migrate Azure Database for MySQL to BigQuery once instead of syncing it?
Yes: export the tables with mysqldump or as CSV and load them with bq load, after converting the schema with the free MySQL to BigQuery schema converter. A one-time copy goes stale as soon as MySQL changes, so use replication if reports need current data.
Your MySQL data in BigQuery today
Free during early access. Set it up yourself in about 15 minutes, or we'll do it with you on a call.