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:

  1. Configure the external server[master]
  2. Create the source representation instance[slave]
  3. Setup the Cloud SQL replica

Steps to setup the external server

  1. Launch the Compute Engine public VM and install the MySQL_5.7 in it.
  2. 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]
  3. Restart the MySQL server
  4. Create a database and insert some data in it.
  5. 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.