docker-compose.yml 启动失败

来源:6-3 Docker Compose的安装和基本使用

k8svip

2018-06-21

Warning: mysqli::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in Standard input code on line 22


Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in Standard input code on line 22


MySQL Connection Error: (2054) The server requested authentication method unknown to the client





===========

[vagrant@localhost test]$ cat docker-compose.yml

version: '3'


services:


  wordpress:

    image: wordpress

    ports:

      - 8080:80

    environment:

      WORDPRESS_DB_HOST: mysql

      WORDPRESS_DB_PASSWORD: root

    networks:

      - my-bridge


  mysql:

    image: mysql

    environment:

      MYSQL_ROOT_PASSWORD: root

      MYSQL_DATABASE: wordpress

    volumes:

      - mysql-data:/var/lib/mysql

    networks:

      - my-bridge


volumes:

  mysql-data:


networks:

  my-bridge:

    driver: bridge

[vagrant@localhost test]$


写回答

1回答

麦兜搞IT

2018-06-21

您好,把mysql的image改成5.7吧
mysql:5.7

0
1
k8svip
解决了,1个原因是5.7,还有一个原因是要把启动失败时创建的volum删除去 docker volum rm xx
2018-06-22
共1条回复

系统学习Docker 践行DevOps理念

无论你是开发、测试还是运维,Docker都是你的必备技能。

3297 学习 · 1895 问题

查看课程