gpt4 book ai didi

mysql - docker 撰写 : The server requested authentication method unknown to the client

转载 作者:IT老高 更新时间:2023-10-28 21:24:42 25 4
gpt4 key购买 nike

我有这个 yml 文件用于在 docker 中配置 MySQL:

# Use root/example as user/password credentials
version: '3.1'

services:

db:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: 'pass'
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'pass'

adminer:
image: adminer
restart: always
ports:
- 8888:8080

我使用以下命令从 yml 所在的同一目录启动容器:

docker-compose -f stack.yml up

然后我得到了这个错误:

then i get following error while logging in

最佳答案

如果您遇到此错误但仍希望使用 MySQL v.8。您可以通过告诉 MySQL Server 使用旧的身份验证插件来做到这一点。

因此,您的撰写文件将如下所示:

# Use root/example as user/password credentials

version: '3.1'

services:

db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: 'pass'
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'pass'

adminer:
image: adminer
restart: always
ports:
- 8888:8080

关于mysql - docker 撰写 : The server requested authentication method unknown to the client,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50097032/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com