A docker testing environment for mysql master and slave
Go to file
2019-09-27 15:09:35 +08:00
master remove customize dockerfile 2019-09-27 15:09:35 +08:00
slave remove customize dockerfile 2019-09-27 15:09:35 +08:00
.gitignore init project 2019-09-27 14:30:33 +08:00
docker-compose.yml remove customize dockerfile 2019-09-27 15:09:35 +08:00
README.md Update docs 2019-09-27 14:33:30 +08:00

Mysql master-slave docker testing environment

Requirements

Please make sure you have installed docker, docker-compose before following steps.

Run the mysql master and slave

docker-compose up

Then mysql master will listen on localhost:33065 and slave will listen on localhost:33066.

Connect slave to master

Connect to your mysql slave and execute the SQL.

CHANGE MASTER TO
    MASTER_HOST='mysql-master',
    MASTER_USER='root',
    MASTER_PASSWORD='root',
    MASTER_LOG_FILE='replicas-mysql-bin.000003',
    MASTER_LOG_POS=154;

Restart slave

Connect to your mysql slave and execute the SQL.

stop slave;
start slave;