docker-compose.yml
version: '3' services: mysql: image: mysql:8 container_name: mysql8 ports: - 3306:3306 network_mode: "host" restart: always privileged: true volumes: - /home/mysql8/data:/var/lib/mysql - /home/mysql8/conf.d:/etc/mysql/conf.d command: --explicit_defaults_for_timestamp=true --lower_case_table_names=1 --max_allowed_packet=128M --default-authentication-plugin=mysql_native_password environment: - TZ=Asia/Shanghai - LANG=C.UTF-8 - MYSQL_ROOT_PASSWORD=root