wordpress 连接mysql认证问题

来源:6-1 根据前面所学部署一个wordpress

timyl_geng

2018-05-05

老师好,部署了mysql和wp容器,docker ps看都是运行,但是我看了下wp容器的logs,出现容下的内容,过了几秒,wp容器就自动exit了,查了半天没有看找到答案啊。。。

[root@docker-node1 vagrant]# 

[root@docker-node1 vagrant]# docker ps

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES

12215bf66aa1        wordpress           "docker-entrypoint.s…"   3 seconds ago       Up 3 seconds        0.0.0.0:8888->80/tcp   my-wp

120a02222088        mysql               "docker-entrypoint.s…"   2 minutes ago       Up 2 minutes        3306/tcp               mysql

[root@docker-node1 vagrant]# docker logs my-wp

WordPress not found in /var/www/html - copying now...

Complete! WordPress has been successfully copied to /var/www/html


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


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


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


写回答

1回答

麦兜搞IT

2018-05-05

您好,可能是mysql最新版本的问题。您可以在mysql image那指定版本,比如mysql:5.7试试

0
3
麦兜搞IT
回复
qq_无痕_69
这个比较特殊,应为mysql的新版本认证方式发生了变化,所以我们这里用5.7这个稍微旧一点的版本。
2019-07-18
共3条回复

系统学习Docker 践行DevOps理念

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

3297 学习 · 1895 问题

查看课程