Note: Google Cloud MySQL automatically manages its binary log retention period. By default, binary logs are purged after 7 days. If your connector is paused for more than 7 days, you may be required to re-sync your data.
Follow these instructions to replicate your Google Cloud 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,
22.214.171.124) or domain (
- Your database’s port (usually
- TLS enabled on your database (if you want to connect to Fivetran directly)
- 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 for connecting via an SSH tunnel, see Fivetran’s Connection Options page.
Choose your connection optionlink
Google Cloud MySQL products require client certificates to connect to a database that is configured to require SSL. Fivetran only supports Server Certificate authentication.
To connect Fivetran to your Google Cloud MySQL product, you must perform either of these two actions:
- Select the Allow Unsecured Connections option from the Connections tab of your Cloud SQL instance.
- Create a Google Cloud Virtual Machine to act as a proxy to connect using one of these options:
Allow access to masterlink
Your Google Cloud MySQL master server needs to be made accessible to Fivetran’s data processing server.
In your MySQL Dashboard, select the “Master” instance you would like to use.
Note the Master IP address and port number (3306 by default).
Add Fivetran’s IP addresses to access the port number of your master node unless you already have 0.0.0.0/0 as an allowed network.
Check that binary logging is enabled (optional)link
By default, Google enables binary logging through point-in-time recovery for MySQL master databases. To confirm that binary logging is enabled on your database, follow the steps below.
In your MySQL Dashboard, click Backups in the left menu.
In the Settings section, confirm that Enable point-in-time recovery is set to Enabled.
If point-in-time recovery is disabled, you must enable it. Click Edit.
In the Edit backups settings window, select the Enable point-in-time recovery box to enable binary logging.
NOTE: Your Cloud SQL instance will restart when you enable point-in-time recovery.
Next, you must create a Fivetran user in your Google Cloud MySQL database. Make sure to do this on the master node because replicas are read-only.
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 Google Cloud MySQL database using your favorite SQL tool (for example, MySQL Workbench or the “mysql” command in your operating system’s terminal window).
Create a Fivetran user and grant replication permissions by running the following SQL commands. Replace
passwordwith a username and password of your choice…
CREATE USER '<username>'@'%' IDENTIFIED BY 'password'; GRANT SELECT, REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO '<username>'@'%';
Choose schema prefixlink
Each schema from your source database will be mapped to a schema in the destination by adding a prefix to the original schema name. For example, if your original database contains schemas “foo” and “bar” and if you choose the prefix “pre”, then you will get schemas “pre_foo” and “pre_bar” in the output.