docker安装mysql8

 

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

 

上一篇:Linux二进制包安装Mysql8主从复制


下一篇:MySQL8的WITH查询学习