Google Cloud MySQL Setup Guide
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.1.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.
- IP (for example, 18.104.22.168) or host (your.server.com)
- Port (usually 3306)
For the prerequisites for connecting via an SSH tunnel, see Fivetran's Connection Options page.
The replica ID is a unique ID within the MySQL replica set. It must be an integer different from all other master and replica server IDs within the same group. By default, the replica ID is a random integer greater than 1000.
Choose your connection option
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 master
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)
Google enables binary logging for master MySQL databases by default. To confirm that binary logging is enabled on your database, follow the steps below.
In your MySQL Dashboard, click Backups in the left menu.
Confirm that Binary logging is set to Enabled.
If binary logging is disabled, you must enable it. Click Manage Automated Backups.
Click on the Enable point-in-time recovery box to enable binary logging.
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 password of your choice.
CREATE USER 'fivetran'@'%' IDENTIFIED BY 'password'; GRANT SELECT, REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO 'fivetran'@'%';
Choose schema prefix
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.