Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker 启动 msyql 初始化报错 #1178

Open
baicaiit opened this issue Sep 9, 2021 · 5 comments
Open

docker 启动 msyql 初始化报错 #1178

baicaiit opened this issue Sep 9, 2021 · 5 comments
Assignees
Labels

Comments

@baicaiit
Copy link

baicaiit commented Sep 9, 2021

问题描述
[ERROR] [Entrypoint]: MYSQL_USER="root", MYSQL_USER and MYSQL_PASSWORD are for configuring a regular user and cannot be used for the root user

问题描述
docker 启动的时候 mysql没法初始化 mysql版本尝试过 8 和 5.7

截图
image

@baicaiit
Copy link
Author

baicaiit commented Sep 9, 2021

解决了 文档要改一下 env那里 不能有 MYSQL_USER=root

@baicaiit
Copy link
Author

baicaiit commented Sep 9, 2021

然后python 那边有需要这个参数 就会矛盾 希望优化一下

@baicaiit
Copy link
Author

baicaiit commented Sep 9, 2021

image
image
改成这样就ok了 不使用env_file那种形式

@tomlinux
Copy link

tomlinux commented Sep 24, 2021

docker-compose.yml

version: '3.7'
services:
  web:
    image: alenx/walle-web:2.1
    container_name: walle-nginx
    hostname: nginx-web
    ports:
    # 如果宿主机80端口被占用,可自行修改为其他port(>=1024)
    # 0.0.0.0:要绑定的宿主机端口:docker容器内端口80
      - "88:80"
    depends_on:
      - python
    networks:
      - walle-net
    restart: always

  python:
    image: alenx/walle-python:2.1
    container_name: walle-python
    hostname: walle-python
    env_file:
      # walle.env需和docker-compose在同级目录
      - ./walle.env
    volumes:
      - /tmp/walle/codebase/:/tmp/walle/codebase/
      - /tmp/walle/logs/:/opt/walle-web/logs/
      - /root/.ssh:/root/.ssh/
    command: bash -c "cd /opt/walle_home/ && /bin/bash admin.sh migration &&  python waller.py"
    expose:
      - "5000"
    depends_on:
      - db
    networks:
      - walle-net
    restart: always

  db:
    image: mysql:5.6
    container_name: walle-mysql
    hostname: walle-mysql
    environment:
      MYSQL_USER: "walle"
      MYSQL_PASSWORD: "walle"
      MYSQL_DATABASE: "walle"
      MYSQL_ROOT_PASSWORD: "walle"
      MYSQL_HOST: "db"
      MYSQL_PORT: "3306"
    command: [ '--default-authentication-plugin=mysql_native_password', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
    ports:
      - "3306:3306"
    expose:
      - "3306"
    volumes:
      - /data/walle/mysql:/var/lib/mysql
    networks:
      - walle-net
    restart: always

networks:
  walle-net:
    driver: bridge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants
@henyihanwobushi @meolu @aSmallPing @tomlinux @ZouHongxue @baicaiit and others