- On the MySQL master, enabling Binlog and creating the replication user
- On the MySQL slave, assigning a Server ID and optionally specifying replication database
- Start the replication from the slave by connecting to the master database with the replication user.
The MySQL slave instance on EC2 or on-premises must be the same version or later version as the MySQL RDS instance. In general, you need MySQL slave instance to be MySQL 5.6.13 or later version. Based on this requirement, you need to perform an upgrade of your current MySQL database. Please refer to this post for more information:
2. (MySQL EC2 Salve): Start the MySQL slave database on EC2
First, you can start the slave database on EC2 shown as follows:
To enable the replication, you need to turn on the Binlog option and create a replication user to connect to the MySQL master database to perform the replication.
First, you need know if the Binlog is enabled, you can login to MySQL database and run the following SQL commands:
In this step, you need to configure the server-id and specify the replication database ggdemo. After the change, you need to restart the database instance.
Now, let's test the replication by creating a table in the master database and check the replication.