本文最后更新于 2024年12月2日 晚上
准备存储卷
创建docker-compose.yml
创建文件: /usr/local/mysql80/docker-compose.yml
, 内容如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| version: '3.8' services: mysql80: restart: always image: mysql:8.0.20 hostname: vm-mysql80 container_name: mysql80 environment: TZ: Asia/Shanghai LANG: en_US.UTF-8 MYSQL_ROOT_PASSWORD: admin volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro - ./data:/var/lib/mysql 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: - 3306:3306 - 33060:33060
|