docker-compose设置mysql初始化数据库的字符集

version: '3'
services:
  mysql:
    image: mysql:5.7.24
#    volumes:
#      - ./mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf:ro
    command: [                        #使用 command 可以覆盖容器启动后默认执行的命令
      '--character-set-server=utf8mb4',            #设置数据库表的数据集
      '--collation-server=utf8mb4_unicode_ci',    #设置数据库表的数据集
    ]
    ports:
      - "13306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=testdb
    networks:
      - netapp
    restart: on-failure
    First you jump off the cliff and build your wings on the way down.again and again, time will show you the best result.
                    
                
                
            
        
浙公网安备 33010602011771号