基于docker的mysql8的主从复制
基于docker的mysql8的主从复制 创建mysql的docker镜像 构建docker镜像,其中数据卷配置内容在下面,结构目录如下 version: '3.7' services: db: # images 8.x image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: 456123 command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --explicit_defaults_for_timestamp=true --lower_case_table_names=1 ports: - 3309:3306 volumes: - ./data:/var/lib/mysql - ./my.cnf:/etc/my.cnf 配置mysql的主库 更新配置文件 # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute