docker-compose.yml

version: "2"
services:
  mysql:
    image: mysql:5.7.35
    restart: always
    container_name: mysql
    privileged: true
    user: root
    command: "--default-authentication-plugin=mysql_native_password --server-id=1  --log-bin=mysql-bin --binlog-format=ROW --lower-case-table-names=1 --sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION  --max_connections=3000  --event_
scheduler=on"
    ports:
    - 3306:3306
    volumes:
    - "/etc/localtime:/etc/localtime:ro"
    - "./mysql/datadir57:/var/lib/mysql:rw"
    environment:
    - TZ=Asia/Shanghai
    - MYSQL_ROOT_PASSWORD=root

更多推荐

mysql 安装之 docer