请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

docker-compose.yml 启动失败

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回答

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

0 回复 有任何疑惑可以回复我~
  • 提问者 k8svip #1
    解决了,1个原因是5.7,还有一个原因是要把启动失败时创建的volum删除去
    docker volum rm xx
    回复 有任何疑惑可以回复我~ 2018-06-22 21:03:40
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信