docker-compose2.yml 617 B

1234567891011121314151617181920
  1. version: '3.1'
  2. services:
  3. mysql:
  4. restart: always
  5. image: mysql:5.6
  6. container_name: mysql
  7. ports:
  8. - 3306:3306
  9. environment:
  10. TZ: Asia/Shanghai
  11. MYSQL_ROOT_PASSWORD: 123456
  12. command:
  13. --character-set-server=utf8mb4
  14. --collation-server=utf8mb4_general_ci
  15. --explicit_defaults_for_timestamp=true
  16. --lower_case_table_names=1
  17. --max_allowed_packet=128M
  18. --sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO"
  19. volumes:
  20. - /usr/local/docker/mysql/mysql-data:/var/lib/mysql