Note: You can connect Fivetran to a read replica of your Azure MySQL database to ensure that we don’t add any strain to your master database. Many production environments include a read replica by default; if yours doesn’t, you can create one.
Follow these instructions to replicate your Azure MySQL database to your destination via Fivetran.
To connect your MySQL database to Fivetran, you need:
- MySQL version 5.5 or above for non-RDS databases (5.5.40 is the earliest version tested). MySQL version 5.6.13 or above for RDS databases.
- Your database host’s IP (for example,
18.104.22.168) or domain (
- Your database’s port (usually
- A unique replica ID for Fivetran. We need this ID because we connect to your database as a replica. We provide a random replica ID in your setup form, but you can provide your own if you’d prefer or if the form’s replica ID conflicts with one of your existing replica IDs.
NOTE: The replica ID is a unique ID within the MySQL replica set. By default, the replica ID is a random integer greater than 1000.
For the prerequisites connecting via an SSH tunnel, see Fivetran’s Connection Options page.
Choose your connection optionlink
First, decide whether to connect Fivetran to your Azure MySQL database directly or through an SSH tunnel. How you configure security groups will differ based on your connection method.
Connect directly (TLS required)link
IMPORTANT: You must have TLS enabled on your database to connect directly to Fivetran.
Fivetran connects directly to your database instance.
Connect via SSHlink
Fivetran connects to a separate server in your network that provides an SSH tunnel to your database. You must connect through SSH if your database is contained within an inaccessible subnet. If you have an SSH connection, follow these instructions before you proceed to the next step.
Allow Fivetran to access your databaselink
You must configure your firewall to grant Fivetran access to your database.
Open the SQL database firewall settings in the Azure consolelink
In the Azure console, select your Azure MySQL resource.
Open the Connection security tab.
Add a new firewall rulelink
If you are connecting directly, create a new rule using Fivetran’s IP as both the Start IP and End IP. If you are connecting through SSH, use your tunnel server’s IP.
Create a Fivetran userlink
Next, create a Fivetran user for your Azure MySQL database. If you are connecting Fivetran to a read replica, you must create the user on your master database because read replicas are read-only. Your read replica will inherit the user from your master database.
WARNING: This user must be reserved for Fivetran use only and must be unique to your connector. For more information, see our MySQL documentation.
Open a connection to your Azure MySQL database using your favorite SQL tool (for example MySQL Workbench or the “mysql” command in your operating system’s terminal window).
Open a connection to your Azure MySQL database using your favorite SQL tool (for example, MySQL Workbench or the
mysqlcommand in your operating system’s terminal window).
Create a Fivetran user and grant replication permissions by running the following SQL commands. Replace
'password'with a username and password of your choice.
CREATE USER <username>@'%' IDENTIFIED WITH mysql_native_password BY 'password'; GRANT SELECT, REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO <username>@'%';
If there are errors when running these commands, you may lack sufficient privileges and should contact your database administrator.
Verify binary log format is set to ROWlink
Azure MySQL’s binary log format is set to ROW by default. Verify that your binary log format is ROW. If not, set the binary log format to ROW in your Azure portal. Fivetran needs ROW format binary logs to perform incremental updates.
Select schema and tableslink
Select which schemas and tables you’d like to sync to your destination.
Choose a schema prefixlink
Fivetran maps the schemas we discover in your source database to your destination and prepends the destination schema names with a prefix of your choice. For example, if your original database contains schemas
bar and if you choose the prefix
pre, then your destination schemas will be
Enter user and password in setup formlink
In your Fivetran setup form, enter your user and password.
- For the User, enter
<servername>is part of your Azure host URL:
- For the Password, enter the password you set when you created the Fivetran user.
Configure replica (history mode only)link
If you have connected Fivetran to a read replica and plan to run your connector on history mode, do the following:
Connect to your read replica as a user with
Check your read replica’s
0, you do not need to any additional configuration.
slave_parallel_workersvalue is not
0, do the following:
Run the following commands to update the
SET GLOBAL slave_parallel_type = 'LOGICAL_CLOCK'; SET GLOBAL slave_preserve_commit_order = 1;
Next, connect to your master instance as a user with
SUPERprivileges, then run the following command to set the
SET GLOBAL binlog_order_commits = 1;
Learn more about these variables in MySQL’s replica server variables documentation.