-- MySQL replication minimal setup with Docker on macOS mkdir -p ~/test/m1 ~/test/m2 vi ~/test/m1/my.cnf -------- [mysqld] skip-host-cache skip-name-resolve server-id=1 log-bin=mysql-bin -------- vi ~/test/m2/my.cnf -------- [mysqld] skip-host-cache skip-name-resolve server-id=2 log-bin=mysql-bin -------- docker network create n1 docker run --name m1 -e MYSQL_ROOT_PASSWORD=XXX -v ~/test/m1:/etc/mysql/conf.d --net=n1 -d mysql:latest docker run --name m2 -e MYSQL_ROOT_PASSWORD=XXX -v ~/test/m2:/etc/mysql/conf.d --net=n1 -d mysql:latest docker exec -it m1 bash mysql -p create user 'repl'@'%' identified by 'YYY'; grant replication slave on *.* to 'repl'@'%'; show master status; ... ^D docker exec -it m2 mysql -p change master to master_host='m1', master_user='repl', master_port=3306, master_password='YYY', master_log_file='mysql-bin.000003', master_log_pos=156, master_ssl=1; start slave; show slave status \G ...