Another Landing
Test Anthos dramatically simplifies modernizing VMs for a cloud-native…
Problem Context
In this article, we are going to replicate the MySQL from a VM to Cloud SQL using the managed import option.Let’s get started !!Before starting the replication, we need to complete the below steps:
- Configure the external server[master]
- Create the source representation instance[slave]
- Setup the Cloud SQL replica
Steps to setup the external server
- Launch the Compute Engine public VM and install the MySQL_5.7 in it.
- Navigate to /etc/mysql/mysql.conf.d/mysqld.cnf file in the VM and edit it, add the below content in it. [Enabling gtid and binlog]
- Restart the MySQL server
- Create a database and insert some data in it.
- Create a user for replication
Create the source representation instance
- Create the source representation instance by running the below command.
- Create the Cloud SQL replica by running the below command
- After the source representation instance and replica created, it will be shown in the SQL console as shown below.